Skip to content

Commit fac9b0a

Browse files
committed
latest
2 parents e238c7b + eac1d88 commit fac9b0a

15 files changed

+4989
-8227
lines changed

.storybook/main.js

+50-16
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,73 @@
1+
const path = require("path");
12
const commonResolve = require("@bigbinary/neeto-commons-frontend/configs/nanos/webpack/resolve.js");
2-
const projectResolve = require("../resolve.js");
3+
const projectResolve = require("../resolves.js");
34
const { mergeDeepLeft } = require("ramda");
5+
const remarkGfm = require("remark-gfm");
46

57
const { alias } = mergeDeepLeft(projectResolve, commonResolve);
68

79
module.exports = {
8-
core: {
9-
builder: "webpack5",
10-
},
11-
staticDirs: ["./public"],
1210
stories: [
1311
"../stories/**/*.stories.mdx",
14-
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
12+
"../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)",
1513
],
14+
15+
staticDirs: ["./public"],
16+
1617
addons: [
17-
"@storybook/addon-links",
1818
"@storybook/addon-essentials",
19-
"@storybook/addon-interactions",
20-
"@storybook/addon-postcss",
2119
"@storybook/preset-scss",
2220
"storybook-dark-mode",
21+
{
22+
name: "@storybook/addon-postcss",
23+
options: {
24+
cssLoaderOptions: { importLoaders: 1 },
25+
postcssLoaderOptions: { implementation: require("postcss") },
26+
},
27+
},
28+
{
29+
name: "@storybook/addon-docs",
30+
options: {
31+
mdxPluginOptions: {
32+
mdxCompileOptions: {
33+
remarkPlugins: [remarkGfm],
34+
},
35+
},
36+
},
37+
},
2338
],
24-
framework: "@storybook/react",
25-
babel: async options => ({
26-
...options,
27-
plugins: ["@babel/plugin-proposal-class-properties"],
28-
}),
29-
webpackFinal: async (config, { configType }) => {
39+
40+
webpackFinal: async config => {
41+
config.resolve.alias = {
42+
...config.resolve.alias,
43+
...alias,
44+
"@bigbinary/neeto-editor": path.resolve(__dirname, "../src/components"),
45+
};
46+
47+
config.module.rules.find(
48+
rule => rule.test && rule.test.test(".svg")
49+
).exclude = /^(?!.*\.storybook\/).*\.svg$/;
50+
51+
config.module.rules.push({
52+
test: /\.svg$/,
53+
exclude: __dirname,
54+
enforce: "pre",
55+
loader: require.resolve("@svgr/webpack"),
56+
});
57+
3058
config.module.rules.push({
3159
test: /\.js$/,
3260
include: /node_modules\/@bigbinary\/neeto-commons-frontend\/initializers/,
3361
use: { loader: "babel-loader", options: { plugins: ["preval"] } },
3462
});
3563

36-
config.resolve.alias = alias;
64+
config.resolve.extensions.push(".svg");
65+
3766
return config;
3867
},
68+
69+
framework: {
70+
name: "@storybook/react-webpack5",
71+
options: {},
72+
},
3973
};

.storybook/manager.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { addons } from "@storybook/addons";
22
import neetoTheme from "./neetoTheme";
3-
import Favicon from "./public/favicon_light.ico";
43

54
addons.setConfig({
65
theme: neetoTheme,
76
});
87

98
const link = document.createElement("link");
109
link.setAttribute("rel", "shortcut icon");
11-
link.setAttribute("href", Favicon);
10+
link.setAttribute("href", "./favicon_light.ico");
1211
document.head.appendChild(link);

.storybook/neetoTheme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { create } from "@storybook/theming";
1+
import { create } from "@storybook/theming/create";
22
import neetoLogo from "./neetoLogo.svg";
33

44
export default create({

.storybook/preview.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ initializeApplication({
1313
export const parameters = {
1414
layout: "fullscreen",
1515
actions: { argTypesRegex: "^on[A-Z].*" },
16-
controls: {
17-
matchers: {
18-
color: /(background|color)$/i,
19-
date: /Date$/,
20-
},
21-
},
16+
controls: { matchers: { color: /(background|color)$/i, date: /Date$/ } },
2217
options: {
2318
storySort: {
2419
order: [
2520
"Welcome",
2621
"Getting started",
2722
"Walkthroughs",
23+
["Menu", "MenuTypes"],
2824
"API Reference",
2925
["Props", "Editor API"],
3026
"Examples",

package.json

+37-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bigbinary/neeto-editor",
3-
"version": "1.30.13-beta",
3+
"version": "1.31.0-beta",
44
"main": "./index.cjs.js",
55
"module": "./index.js",
66
"types": "./types.d.ts",
@@ -23,10 +23,13 @@
2323
"npm": ">=9",
2424
"yarn": ">=1.22"
2525
},
26+
"resolutions": {
27+
"jackspeak": "2.1.1"
28+
},
2629
"devDependencies": {
27-
"@babel/core": "^7.19.1",
28-
"@babel/eslint-parser": "7.17.0",
29-
"@babel/plugin-transform-runtime": "^7.19.1",
30+
"@babel/core": "7.23.2",
31+
"@babel/eslint-parser": "7.22.15",
32+
"@babel/plugin-transform-runtime": "7.23.2",
3033
"@babel/preset-env": "7.23.2",
3134
"@babel/preset-react": "7.22.15",
3235
"@babel/preset-typescript": "7.23.2",
@@ -35,11 +38,11 @@
3538
"@bigbinary/eslint-plugin-neeto": "1.5.0",
3639
"@bigbinary/neeto-audit-frontend": "^2.0.9",
3740
"@bigbinary/neeto-cist": "1.0.9",
38-
"@bigbinary/neeto-commons-frontend": "3.2.4",
39-
"@bigbinary/neeto-filters-frontend": "3.2.8",
40-
"@bigbinary/neeto-icons": "1.18.0",
41-
"@bigbinary/neeto-molecules": "1.13.8",
42-
"@bigbinary/neetoui": "6.3.8",
41+
"@bigbinary/neeto-commons-frontend": "3.3.0",
42+
"@bigbinary/neeto-filters-frontend": "3.3.1",
43+
"@bigbinary/neeto-icons": "1.18.4",
44+
"@bigbinary/neeto-molecules": "1.15.15",
45+
"@bigbinary/neetoui": "6.5.10",
4346
"@faker-js/faker": "8.2.0",
4447
"@honeybadger-io/js": "6.5.3",
4548
"@honeybadger-io/react": "6.1.9",
@@ -49,18 +52,14 @@
4952
"@rollup/plugin-json": "6.0.1",
5053
"@rollup/plugin-node-resolve": "15.2.3",
5154
"@rollup/plugin-replace": "5.0.4",
52-
"@storybook/addon-actions": "6.5.16",
53-
"@storybook/addon-docs": "6.5.16",
54-
"@storybook/addon-essentials": "6.5.16",
55-
"@storybook/addon-interactions": "6.5.16",
56-
"@storybook/addon-links": "6.5.16",
57-
"@storybook/addon-postcss": "2.0.0",
58-
"@storybook/builder-webpack5": "6.5.16",
59-
"@storybook/manager-webpack5": "6.5.16",
60-
"@storybook/preset-scss": "1.0.3",
61-
"@storybook/react": "6.5.16",
62-
"@storybook/testing-library": "0.0.13",
55+
"@storybook/addon-actions": "^7.5.3",
56+
"@storybook/addon-essentials": "^7.5.3",
57+
"@storybook/addon-postcss": "^2.0.0",
58+
"@storybook/preset-scss": "^1.0.3",
59+
"@storybook/react": "^7.5.3",
60+
"@storybook/react-webpack5": "^7.5.3",
6361
"@svgr/rollup": "8.1.0",
62+
"@svgr/webpack": "^6.5.1",
6463
"@tippyjs/react": "4.2.6",
6564
"@tiptap/extension-bubble-menu": "2.0.0-beta.199",
6665
"@tiptap/extension-character-count": "2.0.0-beta.199",
@@ -80,6 +79,7 @@
8079
"@tiptap/extension-table-row": "2.0.0-beta.199",
8180
"@tiptap/extension-text-style": "2.0.3",
8281
"@tiptap/extension-underline": "2.0.0-beta.199",
82+
"@tiptap/pm": "^2.3.0",
8383
"@tiptap/react": "2.0.0-beta.199",
8484
"@tiptap/starter-kit": "2.0.0-beta.199",
8585
"@tiptap/suggestion": "2.0.0-beta.197",
@@ -89,8 +89,8 @@
8989
"@uppy/url": "2.2.0",
9090
"antd": "5.10.2",
9191
"autoprefixer": "10.4.16",
92-
"axios": "1.6.2",
93-
"babel-loader": "^8.2.5",
92+
"axios": "1.6.0",
93+
"babel-loader": "9.1.3",
9494
"babel-plugin-istanbul": "6.1.1",
9595
"babel-plugin-js-logger": "1.0.17",
9696
"babel-plugin-macros": "3.1.0",
@@ -125,10 +125,10 @@
125125
"js-logger": "1.6.1",
126126
"lint-staged": "15.0.2",
127127
"lowlight": "2.7.0",
128-
"postcss": "8.4.14",
129-
"postcss-import": "14.1.0",
130-
"postcss-loader": "4.3.0",
131-
"postcss-preset-env": "7.8.2",
128+
"postcss": "8.4.31",
129+
"postcss-import": "15.1.0",
130+
"postcss-loader": "7.3.3",
131+
"postcss-preset-env": "9.2.0",
132132
"prettier": "2.6.2",
133133
"prettier-plugin-tailwindcss": "0.1.10",
134134
"qs": "6.11.2",
@@ -147,6 +147,7 @@
147147
"react-query": "3.39.3",
148148
"react-router-dom": "5.3.4",
149149
"react-toastify": "8.2.0",
150+
"remark-gfm": "4.0.0",
150151
"rollup": "2.79.1",
151152
"rollup-plugin-analyzer": "4.0.0",
152153
"rollup-plugin-cleaner": "1.0.0",
@@ -155,7 +156,8 @@
155156
"rollup-plugin-styles": "4.0.0",
156157
"sass": "1.69.5",
157158
"sass-loader": "13.0.2",
158-
"storybook-dark-mode": "^2.1.1",
159+
"storybook": "^7.5.3",
160+
"storybook-dark-mode": "^3.0.1",
159161
"style-loader": "3.3.1",
160162
"tailwindcss": "3.4.1",
161163
"tippy.js": "6.3.7",
@@ -168,15 +170,15 @@
168170
"peerDependencies": {
169171
"@bigbinary/babel-preset-neeto": "latest",
170172
"@bigbinary/neeto-cist": "latest",
171-
"@bigbinary/neeto-commons-frontend": "3.2.4",
172-
"@bigbinary/neeto-filters-frontend": "3.2.8",
173-
"@bigbinary/neeto-icons": "1.18.0",
174-
"@bigbinary/neeto-molecules": "1.13.8",
175-
"@bigbinary/neetoui": "6.3.8",
173+
"@bigbinary/neeto-commons-frontend": "3.3.0",
174+
"@bigbinary/neeto-filters-frontend": "3.3.1",
175+
"@bigbinary/neeto-icons": "1.18.4",
176+
"@bigbinary/neeto-molecules": "1.15.15",
177+
"@bigbinary/neetoui": "6.5.10",
176178
"@honeybadger-io/js": "^6.5.3",
177179
"@honeybadger-io/react": "^6.1.9",
178180
"antd": "4.24.3",
179-
"axios": "1.6.2",
181+
"axios": "^1.6.0",
180182
"classnames": "^2.3.2",
181183
"formik": "^2.4.5",
182184
"i18next": "^23.6.0",
@@ -225,11 +227,11 @@
225227
"tippy.js": "6.3.7"
226228
},
227229
"scripts": {
228-
"build": "build-storybook",
230+
"build": "storybook build",
229231
"bundle": "NODE_ENV=production rollup -c rollup.config.js",
230232
"prepare": "husky install",
231233
"serve": "node .storybook/express",
232-
"storybook": "start-storybook -p 6006"
234+
"storybook": "storybook dev -p 6006"
233235
},
234236
"lint-staged": {
235237
"src/**/*.{js,jsx,json}": [

resolve.js resolves.js

File renamed without changes.

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import copy from "rollup-plugin-copy";
1515
import packageJson from "./package.json";
1616

1717
const commonResolve = require("@bigbinary/neeto-commons-frontend/configs/nanos/webpack/resolve.js");
18-
const projectResolve = require("./resolve.js");
18+
const projectResolve = require("./resolves.js");
1919

2020
const { alias: aliasEntries } = mergeDeepLeft(projectResolve, commonResolve);
2121
const peerDependencies = Object.keys(packageJson.peerDependencies);

src/components/Editor/index.jsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import React, { useImperativeHandle, useState, useRef } from "react";
22

33
import { useEditor, EditorContent } from "@tiptap/react";
44
import classnames from "classnames";
5+
import { EDITOR_OPTIONS } from "common/constants";
56
import { noop, slugify } from "neetocist";
6-
import { useFuncDebounce } from "neetocommons/react-utils";
77
import { Label } from "neetoui";
88
import { EditorView } from "prosemirror-view";
99

10-
import { EDITOR_OPTIONS } from "common/constants";
1110
import ErrorWrapper from "components/Common/ErrorWrapper";
1211
import useEditorWarnings from "hooks/useEditorWarnings";
1312

@@ -115,11 +114,6 @@ const Editor = (
115114
});
116115
useEditorWarnings({ initialValue });
117116

118-
const handleChange = useFuncDebounce(
119-
({ editor }) => onChange(editor.getHTML()),
120-
100
121-
);
122-
123117
const editorClasses = classnames("neeto-editor", {
124118
"slash-active": isSlashCommandsActive && !isPlaceholderActive,
125119
"fixed-menu-active border": isFixedMenuActive,
@@ -155,7 +149,7 @@ const Editor = (
155149
},
156150
parseOptions: { preserveWhitespace: true },
157151
onCreate: ({ editor }) => !autoFocus && setInitialPosition(editor),
158-
onUpdate: handleChange,
152+
onUpdate: ({ editor }) => onChange(editor.getHTML()),
159153
onFocus,
160154
onBlur,
161155
});

stories/API-Reference/All-props.stories.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import { Editor } from "../../src";
2020

2121
# **Props**
2222

23-
export const Template = args => <Editor {...args} />;
24-
25-
<Story name="All Props"> {Template.bind({})}</Story>
23+
<Story name="All Props">
24+
<Editor autoFocus />
25+
</Story>
2626

2727
<div id="hide-controls-column">
2828
<ArgsTable story="All Props" />

stories/Examples/Menu.stories.mdx

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs";
22
import { MENU_PROPS } from "./constants";
33
import { Editor, Menu } from "../../src";
44
import { buildArgValues } from "../utils";
5+
import Table from "../components/Table";
56

67
<Meta
78
title="Walkthroughs/Menu"
@@ -13,7 +14,6 @@ import { buildArgValues } from "../utils";
1314
},
1415
}}
1516
component={Editor}
16-
argTypes={buildArgValues(MENU_PROPS)}
1717
/>
1818

1919
# Use Menu as an independant component
@@ -23,13 +23,8 @@ content. In such cases use the `Menu` component.
2323

2424
### Props
2525

26-
export const Template = args => <Menu {...args} />;
26+
<Table columns={["Name", "Description", "Default"]} rows={MENU_PROPS} />
2727

28-
<Story name="Menu"> {Template.bind({})}</Story>
29-
30-
<div id="hide-controls-column">
31-
<ArgsTable story="Menu" />
32-
</div>
3328

3429
[Independant menu component](https://neeto-editor.neeto.com/?path=/docs/examples-independent-menu-component--page)
3530
section shows an example with the `Menu` component in action.

stories/Walkthroughs/Formik.stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Meta, Canvas } from "@storybook/addon-docs";
22
import FormikEditorDemo from "./FormikEditorDemo";
3-
import FormikEditor from "../../src";
3+
import { FormikEditor } from "../../src";
44

55
<Meta
66
title="Walkthroughs/Formik"

0 commit comments

Comments
 (0)