@silexlabs/silex 3.7.0 → 3.9.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -78
- package/common/examples/plugin.js +6 -0
- package/common/silex-plugins/config.test.ts +71 -0
- package/common/silex-plugins/config.ts +25 -0
- package/common/silex-plugins/index.ts +2 -0
- package/common/silex-plugins/plugin.test.ts +57 -0
- package/common/silex-plugins/plugin.ts +65 -0
- package/dist/client/css/admin.css +25 -12
- package/dist/client/css/all.min.css +5 -5
- package/dist/client/index.html +2 -2
- package/dist/client/js/main.js +3108 -2940
- package/dist/client/js/main.js.LICENSE.txt +6 -4
- package/dist/client/webfonts/fa-brands-400.woff2 +0 -0
- package/dist/client/webfonts/fa-regular-400.woff2 +0 -0
- package/dist/client/webfonts/fa-solid-900.woff2 +0 -0
- package/dist/client/webfonts/fa-v4compatibility.woff2 +0 -0
- package/dist/server/common/externs.js +2 -0
- package/dist/server/common/silex-plugins/config.js +25 -0
- package/dist/server/common/silex-plugins/index.js +18 -0
- package/dist/server/common/silex-plugins/plugin.js +41 -0
- package/dist/server/server/api/api.js +9 -9
- package/dist/server/server/api/connectorApi.js +35 -35
- package/dist/server/server/api/publicationApi.js +19 -19
- package/dist/server/server/api/websiteApi.js +46 -46
- package/dist/server/server/config.js +19 -19
- package/dist/server/server/connectors/FsHosting.js +6 -6
- package/dist/server/server/connectors/FsStorage.js +35 -35
- package/dist/server/server/connectors/connectors.js +3 -3
- package/dist/server/server/expose.js +18 -8
- package/dist/server/server/express.js +3 -3
- package/dist/server/server/index.js +29 -19
- package/dist/server/server/jobs.js +4 -4
- package/dist/{plugins/server/plugins/server → server/server/plugins}/DownloadConnector.js +23 -28
- package/dist/{plugins/server/plugins/server → server/server/plugins}/FtpConnector.js +42 -117
- package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabConnector.js +80 -271
- package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabHostingConnector.js +11 -134
- package/dist/server/server/plugins/PublicationOptimizer.js +2 -0
- package/dist/{plugins/server/plugins/server → server/server/plugins}/SslPlugin.js +3 -32
- package/dist/{plugins/server/plugins/server → server/server/plugins}/StaticPlugin.js +4 -21
- package/dist/server/server/utils/BackwardCompat.js +2 -0
- package/dist/server/server/utils/websiteDataSerialization.js +10 -10
- package/{src/ts/client → editor}/api.ts +2 -2
- package/{src/ts/client → editor}/assetUrl.test.ts +6 -33
- package/{src/ts/client → editor}/assetUrl.ts +2 -2
- package/{src/ts/client → editor}/config.ts +3 -3
- package/{src/css/theme-modern.scss → editor/css/design-system.scss} +29 -14
- package/{src → editor}/css/index.scss +1 -3
- package/{src → editor}/css/project-bar.scss +5 -0
- package/{src/ts/client → editor}/expose.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/LoginDialog.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/PublicationManager.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/PublicationUi.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/index.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/page-settings.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/publication.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/eleventy.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/index.ts +5 -3
- package/{src/ts/client → editor}/grapesjs/internal-links.ts +2 -2
- package/{src/ts/client → editor}/grapesjs/resize-panel.ts +2 -1
- package/{src/ts/client → editor}/grapesjs/settings-sections.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/settings.ts +2 -2
- package/{src/ts/client → editor}/grapesjs/storage.ts +1 -1
- package/editor/grapesjs/website-info.ts +52 -0
- package/{src/ts/client → editor}/index.ts +1 -1
- package/{src/ts/client → editor}/publication-transformers.test.ts +10 -10
- package/{src/ts/client → editor}/publication-transformers.ts +1 -1
- package/{src/ts/client → editor}/publish-fonts.ts +2 -2
- package/grapesjs-plugins/expression-input/.husky/pre-commit +2 -0
- package/grapesjs-plugins/expression-input/.prettierrc.json +7 -0
- package/grapesjs-plugins/expression-input/.vscode/extensions.json +9 -0
- package/grapesjs-plugins/expression-input/CHANGELOG.md +47 -0
- package/grapesjs-plugins/expression-input/LICENSE +661 -0
- package/grapesjs-plugins/expression-input/README.md +59 -0
- package/grapesjs-plugins/expression-input/babel.config.js +3 -0
- package/grapesjs-plugins/expression-input/commitlint.config.js +1 -0
- package/grapesjs-plugins/expression-input/dev/README.md +1 -0
- package/grapesjs-plugins/expression-input/dev/expression-input.html +148 -0
- package/grapesjs-plugins/expression-input/dev/input-chain.html +88 -0
- package/grapesjs-plugins/expression-input/dev/popin-form.html +83 -0
- package/grapesjs-plugins/expression-input/docs/expression-input.md +173 -0
- package/grapesjs-plugins/expression-input/docs/popin-form.md +228 -0
- package/grapesjs-plugins/expression-input/eslint.config.mjs +71 -0
- package/grapesjs-plugins/expression-input/package.json +84 -0
- package/grapesjs-plugins/expression-input/playwright.config.ts +6 -0
- package/grapesjs-plugins/expression-input/rollup.config.js +39 -0
- package/grapesjs-plugins/expression-input/src/expression-input.ts +339 -0
- package/grapesjs-plugins/expression-input/src/index.ts +3 -0
- package/grapesjs-plugins/expression-input/src/input-chain.ts +216 -0
- package/grapesjs-plugins/expression-input/src/popin-form.ts +189 -0
- package/grapesjs-plugins/expression-input/src/popin-overlay.ts +188 -0
- package/grapesjs-plugins/expression-input/src/styles.ts +374 -0
- package/grapesjs-plugins/expression-input/src/test/popin-form_test.ts +47 -0
- package/grapesjs-plugins/expression-input/tsconfig.json +34 -0
- package/grapesjs-plugins/expression-input/web-dev-server.config.js +25 -0
- package/grapesjs-plugins/expression-input/web-test-runner.config.js +124 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/.editorconfig +5 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/.husky/pre-commit +4 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/README.md +158 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/babel.config.js +3 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/eslint.config.mjs +20 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/index.html +353 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/jest.config.cjs +11 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/package-lock.json +12500 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/package.json +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/public/simple-selector.html +12 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/StylableElement.ts +15 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/capabilities.ts +49 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/commands.ts +89 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/complex-selector.ts +187 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/compound-selector.ts +241 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/current-selector-display.ts +289 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/inline-select.ts +199 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/resize-input.ts +19 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/simple-selector.ts +537 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/en.ts +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/fr.ts +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/index.ts +47 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.test.ts +380 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.ts +231 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.test.ts +232 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.ts +128 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.test.ts +1077 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.ts +653 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.test.ts +45 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.ts +129 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.test.ts +31 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.ts +159 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.test.ts +181 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.ts +379 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/plugin.ts +225 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/styles.ts +40 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/test-data.json +3546 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/tsconfig.json +37 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/LICENSE +17 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/README.md +129 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/_index.html +37 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/package-lock.json +9023 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/package.json +46 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/src/index.js +97 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/test/index.test.js +198 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-css-variables/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-css-variables/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-css-variables/README.md +172 -0
- package/grapesjs-plugins/grapesjs-css-variables/TEST_SCENARIOS.md +181 -0
- package/grapesjs-plugins/grapesjs-css-variables/_index.html +93 -0
- package/grapesjs-plugins/grapesjs-css-variables/package-lock.json +9020 -0
- package/grapesjs-plugins/grapesjs-css-variables/package.json +46 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/capabilities.js +133 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/index.js +37 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/locale/en.js +22 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/locale/fr.js +22 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/modal.js +692 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/style-manager.js +461 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/types.js +8 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/variables.js +439 -0
- package/grapesjs-plugins/grapesjs-data-source/.husky/pre-commit +4 -0
- package/grapesjs-plugins/grapesjs-data-source/.nvmrc +1 -0
- package/grapesjs-plugins/grapesjs-data-source/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-data-source/README.md +674 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-schema.json +67137 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-test-schema.json +8393 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/graphql-mocks.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/simple-schema.json +493 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/squidex-schema.json +6656 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/strapi-schema.json +7986 -0
- package/grapesjs-plugins/grapesjs-data-source/_index.html +110 -0
- package/grapesjs-plugins/grapesjs-data-source/babel.config.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/eslint.config.mjs +47 -0
- package/grapesjs-plugins/grapesjs-data-source/example.graphql +355 -0
- package/grapesjs-plugins/grapesjs-data-source/example.graphql.json +5666 -0
- package/grapesjs-plugins/grapesjs-data-source/example.page.json +1 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-response.json +6 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/preview.html +5 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/website.json +79 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-response.json +1056 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/preview.html +36 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/website.json +422 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-result.json +18718 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-types.json +1955 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/graphql-modules.json +191 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/modules.html +45 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-response.json +1056 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/preview.html +31 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/website.json +261 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/website-modules.json +650 -0
- package/grapesjs-plugins/grapesjs-data-source/jest.config.js +21 -0
- package/grapesjs-plugins/grapesjs-data-source/package-lock.json +13182 -0
- package/grapesjs-plugins/grapesjs-data-source/package.json +77 -0
- package/grapesjs-plugins/grapesjs-data-source/src/api.ts +386 -0
- package/grapesjs-plugins/grapesjs-data-source/src/capabilities.ts +80 -0
- package/grapesjs-plugins/grapesjs-data-source/src/commands.ts +269 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/GraphQL.ts +1039 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql-introspection-query.ts +112 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql.test.ts +657 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/index.ts +102 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.test.ts +27 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.ts +985 -0
- package/grapesjs-plugins/grapesjs-data-source/src/index.ts +103 -0
- package/grapesjs-plugins/grapesjs-data-source/src/integration.test.ts +504 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/ExpressionTree.ts +251 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/completion.ts +213 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceManager.ts +315 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.test.ts +170 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.ts +117 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/expressionEvaluator.ts +241 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/previewDataLoader.ts +196 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/queryBuilder.ts +118 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/state.test.ts +76 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/state.ts +243 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/token.ts +336 -0
- package/grapesjs-plugins/grapesjs-data-source/src/storage.test.ts +81 -0
- package/grapesjs-plugins/grapesjs-data-source/src/storage.ts +55 -0
- package/grapesjs-plugins/grapesjs-data-source/src/test-data.ts +154 -0
- package/grapesjs-plugins/grapesjs-data-source/src/types.ts +299 -0
- package/grapesjs-plugins/grapesjs-data-source/src/utils.test.ts +46 -0
- package/grapesjs-plugins/grapesjs-data-source/src/utils.ts +367 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/canvas.ts +718 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/custom-states-editor.ts +371 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/defaultStyles.ts +432 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/index.ts +168 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/properties-editor.ts +249 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/settings.ts +1551 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/state-editor.ts +528 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.editorconfig +16 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.env.example +7 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintignore +3 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintrc +27 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/README.md +57 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/admin.js +13 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/api.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/database.js +92 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/middlewares.js +12 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/server.js +10 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/database/migrations/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/favicon.png +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/jsconfig.json +8 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/package.json +31 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/public/robots.txt +3 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/public/uploads/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/app.example.js +39 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/webpack.config.example.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/content-types/post/schema.json +26 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/controllers/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/routes/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/services/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/extensions/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/index.js +20 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/components.d.ts +5 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/contentTypes.d.ts +723 -0
- package/grapesjs-plugins/grapesjs-data-source/tmp/countries-lists.html +1 -0
- package/grapesjs-plugins/grapesjs-data-source/tsconfig.cjs.json +8 -0
- package/grapesjs-plugins/grapesjs-data-source/tsconfig.json +49 -0
- package/grapesjs-plugins/grapesjs-filter-styles/README.md +137 -0
- package/grapesjs-plugins/grapesjs-filter-styles/eslint.config.mjs +35 -0
- package/grapesjs-plugins/grapesjs-filter-styles/package-lock.json +8927 -0
- package/grapesjs-plugins/grapesjs-filter-styles/package.json +40 -0
- package/grapesjs-plugins/grapesjs-filter-styles/src/index.js +283 -0
- package/grapesjs-plugins/grapesjs-filter-styles/tsconfig.json +26 -0
- package/grapesjs-plugins/grapesjs-fonts/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-fonts/LICENSE +9 -0
- package/grapesjs-plugins/grapesjs-fonts/README.md +231 -0
- package/grapesjs-plugins/grapesjs-fonts/_index.html +95 -0
- package/grapesjs-plugins/grapesjs-fonts/package-lock.json +9024 -0
- package/grapesjs-plugins/grapesjs-fonts/package.json +46 -0
- package/grapesjs-plugins/grapesjs-fonts/src/capabilities.js +61 -0
- package/grapesjs-plugins/grapesjs-fonts/src/commands.js +100 -0
- package/grapesjs-plugins/grapesjs-fonts/src/fonts.js +396 -0
- package/grapesjs-plugins/grapesjs-fonts/src/index.js +34 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/en.js +19 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/fr.js +21 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/ptbr.js +18 -0
- package/grapesjs-plugins/grapesjs-fonts/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/README.md +116 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/package.json +46 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialog.ts +208 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialogManager.ts +78 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/index.ts +70 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-loading/.eslintrc.json +22 -0
- package/grapesjs-plugins/grapesjs-loading/README.md +140 -0
- package/grapesjs-plugins/grapesjs-loading/_index.html +90 -0
- package/grapesjs-plugins/grapesjs-loading/eslint.config.mjs +20 -0
- package/grapesjs-plugins/grapesjs-loading/grapesjs-loading.gif +0 -0
- package/grapesjs-plugins/grapesjs-loading/package.json +50 -0
- package/grapesjs-plugins/grapesjs-loading/src/index.ts +54 -0
- package/grapesjs-plugins/grapesjs-loading/tsconfig.json +20 -0
- package/grapesjs-plugins/grapesjs-notifications/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-notifications/README.md +295 -0
- package/grapesjs-plugins/grapesjs-notifications/_index.html +95 -0
- package/grapesjs-plugins/grapesjs-notifications/package-lock.json +8187 -0
- package/grapesjs-plugins/grapesjs-notifications/package.json +58 -0
- package/grapesjs-plugins/grapesjs-notifications/src/Notification.ts +117 -0
- package/grapesjs-plugins/grapesjs-notifications/src/NotificationManager.ts +93 -0
- package/grapesjs-plugins/grapesjs-notifications/src/Storage.ts +26 -0
- package/grapesjs-plugins/grapesjs-notifications/src/capabilities.ts +33 -0
- package/grapesjs-plugins/grapesjs-notifications/src/commands.ts +5 -0
- package/grapesjs-plugins/grapesjs-notifications/src/index.ts +126 -0
- package/grapesjs-plugins/grapesjs-notifications/src/locale/en.js +8 -0
- package/grapesjs-plugins/grapesjs-notifications/src/view.ts +127 -0
- package/grapesjs-plugins/grapesjs-notifications/tsconfig.json +30 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/LICENSE +213 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/README.md +119 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/jest.config.js +197 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/package-lock.json +10752 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/package.json +44 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.js +90 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.test.js +122 -0
- package/grapesjs-plugins/grapesjs-symbols/.eslintrc.cjs +20 -0
- package/grapesjs-plugins/grapesjs-symbols/.husky/pre-commit +5 -0
- package/grapesjs-plugins/grapesjs-symbols/.nvmrc +1 -0
- package/grapesjs-plugins/grapesjs-symbols/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-symbols/README.md +228 -0
- package/grapesjs-plugins/grapesjs-symbols/_index.html +104 -0
- package/grapesjs-plugins/grapesjs-symbols/es5.html +119 -0
- package/grapesjs-plugins/grapesjs-symbols/es6.html +107 -0
- package/grapesjs-plugins/grapesjs-symbols/eslint.config.mjs +72 -0
- package/grapesjs-plugins/grapesjs-symbols/jest.config.js +12 -0
- package/grapesjs-plugins/grapesjs-symbols/package-lock.json +6867 -0
- package/grapesjs-plugins/grapesjs-symbols/package.json +73 -0
- package/grapesjs-plugins/grapesjs-symbols/rollup.config.mjs +26 -0
- package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.test.ts +147 -0
- package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.ts +144 -0
- package/grapesjs-plugins/grapesjs-symbols/src/capabilities.ts +50 -0
- package/grapesjs-plugins/grapesjs-symbols/src/events.ts +8 -0
- package/grapesjs-plugins/grapesjs-symbols/src/id-utils.ts +158 -0
- package/grapesjs-plugins/grapesjs-symbols/src/index.ts +46 -0
- package/grapesjs-plugins/grapesjs-symbols/src/test-utils.ts +51 -0
- package/grapesjs-plugins/grapesjs-symbols/src/utils.test.ts +118 -0
- package/grapesjs-plugins/grapesjs-symbols/src/utils.ts +90 -0
- package/grapesjs-plugins/grapesjs-symbols/src/view/SymbolsView.ts +251 -0
- package/grapesjs-plugins/grapesjs-symbols/src/view/traits.ts +101 -0
- package/grapesjs-plugins/grapesjs-symbols/tsconfig.json +35 -0
- package/grapesjs-plugins/grapesjs-symbols/tsconfig.test.json +12 -0
- package/grapesjs-plugins/grapesjs-version-flow/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-version-flow/README.md +422 -0
- package/grapesjs-plugins/grapesjs-version-flow/_index.html +494 -0
- package/grapesjs-plugins/grapesjs-version-flow/babel.config.js +9 -0
- package/grapesjs-plugins/grapesjs-version-flow/package-lock.json +11832 -0
- package/grapesjs-plugins/grapesjs-version-flow/package.json +77 -0
- package/grapesjs-plugins/grapesjs-version-flow/prompts/initial.txt +116 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/event-system.js +48 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/index.js +87 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/locale/en.js +26 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/locale/fr.js +26 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/modal-ui.js +562 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/style-manager.js +240 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/upgrade-engine.js +237 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/version-manager.js +117 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/index.test.js +241 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/integration.test.js +227 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/setup.js +67 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/upgrade-engine.test.js +360 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/version-manager.test.js +168 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/version-storage.test.js +203 -0
- package/grapesjs-plugins/grapesjs-version-flow/tsconfig.json +26 -0
- package/package.json +127 -159
- package/{src/ts/server → server}/api/api.ts +6 -6
- package/{src/ts/server → server}/api/connectorApi.ts +5 -5
- package/{src/ts/server → server}/api/publicationApi.ts +7 -7
- package/{src/ts/server → server}/api/websiteApi.ts +7 -8
- package/{src/ts/server → server}/config.ts +14 -12
- package/{src/ts/server → server}/connectors/FsHosting.ts +4 -4
- package/{src/ts/server → server}/connectors/FsStorage.test.ts +2 -2
- package/{src/ts/server → server}/connectors/FsStorage.ts +8 -8
- package/{src/ts/server → server}/connectors/connectors.ts +3 -3
- package/server/deploy/.nvmrc +1 -0
- package/server/deploy/.silex.js +220 -0
- package/server/deploy/client-config.js +17 -0
- package/server/deploy/client-plugins/.gitkeep +0 -0
- package/server/deploy/client-plugins/onboarding.js +67 -0
- package/server/deploy/example.env +25 -0
- package/server/deploy/onboarding.json +22 -0
- package/server/deploy/picto-silex@3x.png +0 -0
- package/server/deploy/server-plugins/dashboard.js +74 -0
- package/server/deploy/server-plugins/onboarding.js +212 -0
- package/server/deploy/silex-platform.yml +75 -0
- package/{src/ts/server → server}/events.ts +2 -2
- package/{src/ts/server → server}/expose.ts +1 -1
- package/{src/ts/server → server}/express.ts +2 -2
- package/{src/ts/server → server}/index.ts +7 -7
- package/{src/ts/server → server}/jobs.test.ts +1 -1
- package/{src/ts/server → server}/jobs.ts +1 -1
- package/server/plugins/DownloadConnector.publish.test.ts +32 -0
- package/server/plugins/DownloadConnector.test.ts +70 -0
- package/{src/ts/plugins/server → server/plugins}/DownloadConnector.ts +22 -10
- package/{src/ts/plugins/server → server/plugins}/FtpConnector.test.ts +3 -3
- package/{src/ts/plugins/server → server/plugins}/FtpConnector.ts +7 -7
- package/{src/ts/plugins/server → server/plugins}/GitlabConnector.ts +9 -26
- package/{src/ts/plugins/server → server/plugins}/GitlabHostingConnector.ts +5 -5
- package/{src/ts/plugins/server → server/plugins}/SslPlugin.ts +2 -2
- package/{src/ts/plugins/server → server/plugins}/StaticPlugin.ts +2 -2
- package/{src/ts/server → server}/utils/BackwardCompat.ts +1 -1
- package/{src/ts/server → server}/utils/websiteDataSerialization.test.ts +2 -2
- package/{src/ts/server → server}/utils/websiteDataSerialization.ts +3 -3
- package/.silex.js +0 -76
- package/dist/client/client/api.d.ts +0 -101
- package/dist/client/client/assetUrl.d.ts +0 -60
- package/dist/client/client/config.d.ts +0 -110
- package/dist/client/client/events.d.ts +0 -23
- package/dist/client/client/expose.d.ts +0 -10
- package/dist/client/client/grapesjs/LoginDialog.d.ts +0 -15
- package/dist/client/client/grapesjs/PublicationManager.d.ts +0 -117
- package/dist/client/client/grapesjs/PublicationUi.d.ts +0 -59
- package/dist/client/client/grapesjs/blocks.d.ts +0 -1
- package/dist/client/client/grapesjs/body-remap.d.ts +0 -15
- package/dist/client/client/grapesjs/breadcrumbs.d.ts +0 -1
- package/dist/client/client/grapesjs/cms/DataSource.d.ts +0 -43
- package/dist/client/client/grapesjs/cms/blocks.d.ts +0 -2
- package/dist/client/client/grapesjs/cms/buttons.d.ts +0 -2
- package/dist/client/client/grapesjs/cms/collection-pages.d.ts +0 -4
- package/dist/client/client/grapesjs/cms/config.d.ts +0 -9
- package/dist/client/client/grapesjs/cms/filters.d.ts +0 -3
- package/dist/client/client/grapesjs/cms/index.d.ts +0 -43
- package/dist/client/client/grapesjs/cms/liquid.d.ts +0 -73
- package/dist/client/client/grapesjs/cms/page-settings.d.ts +0 -6
- package/dist/client/client/grapesjs/cms/publication.d.ts +0 -60
- package/dist/client/client/grapesjs/cms/site-settings.d.ts +0 -3
- package/dist/client/client/grapesjs/cms/states.d.ts +0 -8
- package/dist/client/client/grapesjs/cms/traits.d.ts +0 -8
- package/dist/client/client/grapesjs/core-commands.d.ts +0 -3
- package/dist/client/client/grapesjs/css-props.d.ts +0 -6
- package/dist/client/client/grapesjs/flex.d.ts +0 -3
- package/dist/client/client/grapesjs/footer.d.ts +0 -2
- package/dist/client/client/grapesjs/img.d.ts +0 -6
- package/dist/client/client/grapesjs/index.d.ts +0 -9
- package/dist/client/client/grapesjs/internal-links.d.ts +0 -1
- package/dist/client/client/grapesjs/keymaps.d.ts +0 -123
- package/dist/client/client/grapesjs/li.d.ts +0 -7
- package/dist/client/client/grapesjs/new-page-dialog.d.ts +0 -2
- package/dist/client/client/grapesjs/openImport.d.ts +0 -9
- package/dist/client/client/grapesjs/page-panel.d.ts +0 -13
- package/dist/client/client/grapesjs/project-bar.d.ts +0 -21
- package/dist/client/client/grapesjs/resize-panel.d.ts +0 -1
- package/dist/client/client/grapesjs/rich-text.d.ts +0 -4
- package/dist/client/client/grapesjs/sectors.d.ts +0 -12
- package/dist/client/client/grapesjs/semantic.d.ts +0 -1
- package/dist/client/client/grapesjs/settings-sections.d.ts +0 -19
- package/dist/client/client/grapesjs/settings.d.ts +0 -16
- package/dist/client/client/grapesjs/storage.d.ts +0 -3
- package/dist/client/client/grapesjs/symbolDialogs.d.ts +0 -4
- package/dist/client/client/grapesjs/upload-progress.d.ts +0 -2
- package/dist/client/client/grapesjs/view-buttons.d.ts +0 -2
- package/dist/client/client/index.d.ts +0 -10
- package/dist/client/client/publication-transformers.d.ts +0 -42
- package/dist/client/client/publish-custom-code-block.d.ts +0 -4
- package/dist/client/client/publish-fonts.d.ts +0 -4
- package/dist/client/client/utils.d.ts +0 -23
- package/dist/client/constants.d.ts +0 -35
- package/dist/client/page.d.ts +0 -2
- package/dist/client/types.d.ts +0 -365
- package/dist/client/webfonts/fa-brands-400.ttf +0 -0
- package/dist/client/webfonts/fa-regular-400.ttf +0 -0
- package/dist/client/webfonts/fa-solid-900.ttf +0 -0
- package/dist/client/webfonts/fa-v4compatibility.ttf +0 -0
- package/dist/plugins/client/client/events.d.ts +0 -23
- package/dist/plugins/client/client/events.js +0 -43
- package/dist/plugins/client/client/events.js.map +0 -1
- package/dist/plugins/client/plugins/client/template.d.ts +0 -2
- package/dist/plugins/client/plugins/client/template.js +0 -234
- package/dist/plugins/client/plugins/client/template.js.map +0 -1
- package/dist/plugins/client/plugins/client/website-info.d.ts +0 -1
- package/dist/plugins/client/plugins/client/website-info.js +0 -72
- package/dist/plugins/client/plugins/client/website-info.js.map +0 -1
- package/dist/plugins/client/types.d.ts +0 -365
- package/dist/plugins/client/types.js +0 -83
- package/dist/plugins/client/types.js.map +0 -1
- package/dist/plugins/server/constants.d.ts +0 -35
- package/dist/plugins/server/constants.js +0 -79
- package/dist/plugins/server/constants.js.map +0 -1
- package/dist/plugins/server/page.d.ts +0 -2
- package/dist/plugins/server/page.js +0 -35
- package/dist/plugins/server/page.js.map +0 -1
- package/dist/plugins/server/plugins/server/Cache.d.ts +0 -2
- package/dist/plugins/server/plugins/server/Cache.js +0 -36
- package/dist/plugins/server/plugins/server/Cache.js.map +0 -1
- package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +0 -29
- package/dist/plugins/server/plugins/server/DownloadConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/FtpConnector.d.ts +0 -86
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +0 -172
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +0 -23
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js +0 -14
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +0 -1
- package/dist/plugins/server/plugins/server/SslPlugin.d.ts +0 -1
- package/dist/plugins/server/plugins/server/SslPlugin.js.map +0 -1
- package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +0 -8
- package/dist/plugins/server/plugins/server/StaticPlugin.js.map +0 -1
- package/dist/plugins/server/server/config.d.ts +0 -59
- package/dist/plugins/server/server/config.js +0 -181
- package/dist/plugins/server/server/config.js.map +0 -1
- package/dist/plugins/server/server/connectors/FsHosting.d.ts +0 -14
- package/dist/plugins/server/server/connectors/FsHosting.js +0 -66
- package/dist/plugins/server/server/connectors/FsHosting.js.map +0 -1
- package/dist/plugins/server/server/connectors/FsStorage.d.ts +0 -44
- package/dist/plugins/server/server/connectors/FsStorage.js +0 -303
- package/dist/plugins/server/server/connectors/FsStorage.js.map +0 -1
- package/dist/plugins/server/server/connectors/connectors.d.ts +0 -86
- package/dist/plugins/server/server/connectors/connectors.js +0 -126
- package/dist/plugins/server/server/connectors/connectors.js.map +0 -1
- package/dist/plugins/server/server/events.d.ts +0 -26
- package/dist/plugins/server/server/events.js +0 -31
- package/dist/plugins/server/server/events.js.map +0 -1
- package/dist/plugins/server/server/jobs.d.ts +0 -12
- package/dist/plugins/server/server/jobs.js +0 -79
- package/dist/plugins/server/server/jobs.js.map +0 -1
- package/dist/plugins/server/server/utils/validation.d.ts +0 -7
- package/dist/plugins/server/server/utils/validation.js +0 -37
- package/dist/plugins/server/server/utils/validation.js.map +0 -1
- package/dist/plugins/server/server/utils/websiteDataSerialization.d.ts +0 -24
- package/dist/plugins/server/server/utils/websiteDataSerialization.js +0 -136
- package/dist/plugins/server/server/utils/websiteDataSerialization.js.map +0 -1
- package/dist/plugins/server/types.d.ts +0 -365
- package/dist/plugins/server/types.js +0 -87
- package/dist/plugins/server/types.js.map +0 -1
- package/dist/server/server/cli.js +0 -71
- package/src/css/grapesjs-light.scss +0 -180
- package/src/ts/plugins/client/template.ts +0 -246
- package/src/ts/plugins/client/website-info.ts +0 -84
- package/src/ts/server/cli.ts +0 -67
- /package/{src/ts → common}/constants.ts +0 -0
- /package/{src/ts → common}/externs.ts +0 -0
- /package/{src/ts → common}/page.ts +0 -0
- /package/{src/ts → common}/types.ts +0 -0
- /package/dist/server/{constants.js → common/constants.js} +0 -0
- /package/dist/server/{page.js → common/page.js} +0 -0
- /package/dist/server/{types.js → common/types.js} +0 -0
- /package/dist/server/{plugins/server → server/plugins}/Cache.js +0 -0
- /package/{src → editor}/css/_mixins.scss +0 -0
- /package/{src → editor}/css/_variables.scss +0 -0
- /package/{src → editor}/css/dialog.scss +0 -0
- /package/{src → editor}/css/dialogs.scss +0 -0
- /package/{src → editor}/css/fonts.scss +0 -0
- /package/{src → editor}/css/footer.scss +0 -0
- /package/{src → editor}/css/grapesjs-plugins.scss +0 -0
- /package/{src → editor}/css/grapesjs.scss +0 -0
- /package/{src → editor}/css/loader.scss +0 -0
- /package/{src → editor}/css/page-panel.scss +0 -0
- /package/{src → editor}/css/panels.scss +0 -0
- /package/{src → editor}/css/silex.scss +0 -0
- /package/{src → editor}/css/theme-base.scss +0 -0
- /package/{src → editor}/css/website-info.scss +0 -0
- /package/{src/ts/client → editor}/events.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/blocks.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/body-remap.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/breadcrumbs.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/DataSource.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/blocks.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/buttons.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/collection-pages.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/config.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/filters.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.mock.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/publication.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/site-settings.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/states.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/traits.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/core-commands.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/css-props.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/flex.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/footer.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/img.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/internal-links.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/keymaps.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/li.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/new-page-dialog.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/openImport.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/page-panel.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/project-bar.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/rich-text.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/sectors.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/semantic.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/static-plugins.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/symbolDialogs.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/upload-progress.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/view-buttons.ts +0 -0
- /package/{src → editor}/html/debug.pug +0 -0
- /package/{src → editor}/html/index.pug +0 -0
- /package/{src → editor}/html/templates/includes.pug +0 -0
- /package/{src → editor}/html/templates/workspace.pug +0 -0
- /package/{src/ts/client → editor}/publish-custom-code-block.ts +0 -0
- /package/{src/ts/client → editor}/utils.ts +0 -0
- /package/{dist/plugins/server/plugins/server/PublicationOptimizer.d.ts → grapesjs-plugins/expression-input/docs/.nojekyll} +0 -0
- /package/{src/ts/plugins/server → server/plugins}/Cache.ts +0 -0
- /package/{src/ts/plugins/server → server/plugins}/PublicationOptimizer.ts +0 -0
- /package/{src/ts/server → server}/utils/validation.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@silexlabs/grapesjs-notifications",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "This GrapesJs plugin is designed to enhance the user experience within the editor by providing a robust notification system. This plugin captures and displays various types of notifications including errors, warnings, and activities, thereby facilitating a more interactive and responsive interface.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"src",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/silexlabs/grapesjs-notifications.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"start": "grapesjs-cli serve",
|
|
19
|
+
"test-build-no-grapes": "rm -rf dist && tsc",
|
|
20
|
+
"build": "grapesjs-cli build --patch=false --dts skip"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"grapesjs-cli": "^4.1.3"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"grapesjs": ">=0.19.0 <0.23.0",
|
|
27
|
+
"lit": "*"
|
|
28
|
+
},
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "Alex Hoyau",
|
|
31
|
+
"url": "https://lexoyo.me/"
|
|
32
|
+
},
|
|
33
|
+
"license": "AGPL-3.0",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/silexlabs/Silex/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/silexlabs/grapesjs-notifications#readme",
|
|
38
|
+
"keywords": [
|
|
39
|
+
"grapesjs",
|
|
40
|
+
"plugin",
|
|
41
|
+
"grapesjs-plugin",
|
|
42
|
+
"notifications",
|
|
43
|
+
"web-design",
|
|
44
|
+
"web-development",
|
|
45
|
+
"UI",
|
|
46
|
+
"UX",
|
|
47
|
+
"error-handling",
|
|
48
|
+
"warning-system",
|
|
49
|
+
"activity-tracker",
|
|
50
|
+
"silex",
|
|
51
|
+
"silexlabs",
|
|
52
|
+
"no-code",
|
|
53
|
+
"editor",
|
|
54
|
+
"web-editor",
|
|
55
|
+
"frontend",
|
|
56
|
+
"website-builder"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Component, Page, Editor } from 'grapesjs'
|
|
2
|
+
|
|
3
|
+
export interface NotificationOptions {
|
|
4
|
+
id?: string
|
|
5
|
+
message: string
|
|
6
|
+
group?: string
|
|
7
|
+
timeout?: number
|
|
8
|
+
componentId?: string
|
|
9
|
+
type: 'info' | 'warning' | 'error' | 'success'
|
|
10
|
+
icons: {
|
|
11
|
+
info: string
|
|
12
|
+
warning: string
|
|
13
|
+
error: string
|
|
14
|
+
success: string
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class Notification {
|
|
19
|
+
id: string | null = null
|
|
20
|
+
componentId: string | null = null
|
|
21
|
+
group: string | null = null
|
|
22
|
+
timeoutRef
|
|
23
|
+
message: string
|
|
24
|
+
type: 'info' | 'warning' | 'error' | 'success'
|
|
25
|
+
options: NotificationOptions
|
|
26
|
+
public model: any // For compatibility
|
|
27
|
+
private removeCallback?: (notification: Notification) => void
|
|
28
|
+
|
|
29
|
+
constructor(protected editor: Editor, options: NotificationOptions | any, removeCallback?: (notification: Notification) => void) {
|
|
30
|
+
this.options = this.getDefaultOptions(options)
|
|
31
|
+
this.removeCallback = removeCallback
|
|
32
|
+
if (this.options.timeout) {
|
|
33
|
+
this.timeoutRef = setTimeout(() => this.remove(), this.options.timeout)
|
|
34
|
+
}
|
|
35
|
+
this.id = options.id || null
|
|
36
|
+
this.message = this.options.message!
|
|
37
|
+
this.type = this.options.type!
|
|
38
|
+
this.componentId = options.componentId || null
|
|
39
|
+
this.group = options.group || null
|
|
40
|
+
this.model = { attributes: options } // For compatibility with existing code
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
select() {
|
|
44
|
+
if (this.options.componentId) {
|
|
45
|
+
// This operation is heavy
|
|
46
|
+
const found = this.getAllComponents(this.editor)
|
|
47
|
+
.find(({component, page}) => component.getId() === this.options.componentId) || null
|
|
48
|
+
if (found) {
|
|
49
|
+
const {component, page} = found
|
|
50
|
+
this.editor.Pages.select(page)
|
|
51
|
+
this.editor.select(component)
|
|
52
|
+
this.editor.Canvas.scrollTo(component)
|
|
53
|
+
} else {
|
|
54
|
+
console.error(`Component with ID ${this.options.componentId} not found`)
|
|
55
|
+
this.editor.runCommand('notifications:add', {
|
|
56
|
+
message: `Component with ID ${this.options.componentId} not found`,
|
|
57
|
+
type: 'error',
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
remove() {
|
|
64
|
+
if (this.removeCallback) {
|
|
65
|
+
this.removeCallback(this)
|
|
66
|
+
} else {
|
|
67
|
+
// Fallback to command if no callback provided
|
|
68
|
+
this.editor.runCommand('notifications:remove', {
|
|
69
|
+
notification: this
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
this.timeoutRef && clearTimeout(this.timeoutRef)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getSvgIcon(type: string): string {
|
|
76
|
+
return this.options.icons?.[type as keyof NotificationOptions['icons']]!
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private getDefaultOptions(opts: Partial<NotificationOptions>): NotificationOptions {
|
|
80
|
+
return {
|
|
81
|
+
...{
|
|
82
|
+
icons: {
|
|
83
|
+
info: '\u{1F6A7}',
|
|
84
|
+
warning: '\u{26A0}',
|
|
85
|
+
error: '\u{1F6AB}',
|
|
86
|
+
success: '\u{2705}',
|
|
87
|
+
group: '\u{1F4CC}',
|
|
88
|
+
...opts.icons,
|
|
89
|
+
},
|
|
90
|
+
}, ...opts
|
|
91
|
+
} as NotificationOptions
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get all components in the editor
|
|
96
|
+
* This is a heavy operation
|
|
97
|
+
*/
|
|
98
|
+
private getAllComponents(editor: Editor) {
|
|
99
|
+
return editor.Pages.getAll().map(page => this.getAllComponentInPage(page)).flat()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private getAllComponentInPage(page: Page): {component: Component, page: Page}[] {
|
|
103
|
+
const body = page.getMainComponent() as Component
|
|
104
|
+
return [{
|
|
105
|
+
component: body,
|
|
106
|
+
page,
|
|
107
|
+
}].concat(
|
|
108
|
+
this.getAllChildrenComponent(body)
|
|
109
|
+
.map(component => ({component, page}))
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private getAllChildrenComponent(component: Component): Component[] {
|
|
114
|
+
const children = Array.from(component.components().models)
|
|
115
|
+
return children.concat(children.map(child => this.getAllChildrenComponent(child)).flat())
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Editor } from "grapesjs"
|
|
2
|
+
import { Notification, NotificationOptions as BaseNotificationOptions } from "./Notification"
|
|
3
|
+
import { StyleInfo } from "lit/directives/style-map.js"
|
|
4
|
+
|
|
5
|
+
export interface NotificationOptions extends BaseNotificationOptions {
|
|
6
|
+
id?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Events
|
|
10
|
+
export const NOTIFICATION_CHANGED = 'notifications:changed'
|
|
11
|
+
export const NOTIFICATION_ADDED = 'notifications:added'
|
|
12
|
+
export const NOTIFICATION_REMOVED = 'notifications:removed'
|
|
13
|
+
export const NOTIFICATION_CLEARED = 'notifications:cleared'
|
|
14
|
+
|
|
15
|
+
export interface NotificationManagerOptions {
|
|
16
|
+
style?: Readonly<StyleInfo>
|
|
17
|
+
container: HTMLElement
|
|
18
|
+
maxNotifications?: number
|
|
19
|
+
reverse?: boolean
|
|
20
|
+
timeout?: number
|
|
21
|
+
storeKey?: string
|
|
22
|
+
i18n?: any
|
|
23
|
+
icons?: {
|
|
24
|
+
info?: string
|
|
25
|
+
warning?: string
|
|
26
|
+
error?: string
|
|
27
|
+
success?: string
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* GrapesJs plugin to manage notifications
|
|
33
|
+
*/
|
|
34
|
+
export class NotificationManager {
|
|
35
|
+
private notifications: Notification[] = []
|
|
36
|
+
|
|
37
|
+
constructor(initialNotifications: any[], protected editor: Editor, protected options: NotificationManagerOptions) {
|
|
38
|
+
// Convert initial data to notification objects
|
|
39
|
+
this.notifications = initialNotifications.map(data => {
|
|
40
|
+
if (typeof data === 'object' && data.message) {
|
|
41
|
+
const removeCallback = (notification: Notification) => this.remove(notification)
|
|
42
|
+
return new Notification(this.editor, data, removeCallback)
|
|
43
|
+
}
|
|
44
|
+
return data
|
|
45
|
+
}).filter(Boolean)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get all notifications
|
|
50
|
+
*/
|
|
51
|
+
getAll(): Notification[] {
|
|
52
|
+
return [...this.notifications]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Add a notification
|
|
57
|
+
*/
|
|
58
|
+
add(options: NotificationOptions): void {
|
|
59
|
+
if (options.id) {
|
|
60
|
+
// Remove any existing notification with the same id
|
|
61
|
+
const existing = this.notifications.find(n => n.options.id === options.id)
|
|
62
|
+
if (existing) {
|
|
63
|
+
this.remove(existing)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const removeCallback = (notification: Notification) => this.remove(notification)
|
|
67
|
+
const notification = new Notification(this.editor, options, removeCallback)
|
|
68
|
+
this.notifications.push(notification)
|
|
69
|
+
this.editor.trigger(NOTIFICATION_ADDED, notification)
|
|
70
|
+
this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Remove a notification
|
|
75
|
+
*/
|
|
76
|
+
remove(notification: Notification | any): void {
|
|
77
|
+
const index = this.notifications.findIndex(n => n === notification || n.model === notification)
|
|
78
|
+
if (index > -1) {
|
|
79
|
+
const removed = this.notifications.splice(index, 1)[0]
|
|
80
|
+
this.editor.trigger(NOTIFICATION_REMOVED, removed)
|
|
81
|
+
this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Clear all notifications
|
|
87
|
+
*/
|
|
88
|
+
reset(): void {
|
|
89
|
+
this.notifications = []
|
|
90
|
+
this.editor.trigger(NOTIFICATION_CLEARED)
|
|
91
|
+
this.editor.trigger(NOTIFICATION_CHANGED, this.getAll())
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Notification } from './Notification'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Storage class
|
|
5
|
+
* Stores the notifications in the local storage
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export class Storage {
|
|
9
|
+
constructor(private storeKey?: string) {}
|
|
10
|
+
|
|
11
|
+
getAll(): any[] {
|
|
12
|
+
if(!this.storeKey) return []
|
|
13
|
+
return JSON.parse(localStorage.getItem(this.storeKey) || '[]')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
save(data: Notification[]) {
|
|
17
|
+
if(!this.storeKey) return
|
|
18
|
+
localStorage.setItem(this.storeKey, JSON.stringify(data.map(n => ({
|
|
19
|
+
message: n.message,
|
|
20
|
+
type: n.type,
|
|
21
|
+
componentId: n.componentId,
|
|
22
|
+
group: n.group,
|
|
23
|
+
timeout: n.options?.timeout
|
|
24
|
+
}))))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NOTIFICATION_ADD, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
2
|
+
|
|
3
|
+
export function registerCapabilities(addCapability: (def: Record<string, unknown>) => void) {
|
|
4
|
+
addCapability({
|
|
5
|
+
id: NOTIFICATION_ADD,
|
|
6
|
+
command: NOTIFICATION_ADD,
|
|
7
|
+
description: 'Show notification to user',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
required: ['type', 'message'],
|
|
11
|
+
properties: {
|
|
12
|
+
type: { type: 'string', enum: ['info', 'warning', 'error', 'success'] },
|
|
13
|
+
message: { type: 'string' },
|
|
14
|
+
group: { type: 'string' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['notifications'],
|
|
18
|
+
})
|
|
19
|
+
addCapability({
|
|
20
|
+
id: NOTIFICATION_CLEAR,
|
|
21
|
+
command: NOTIFICATION_CLEAR,
|
|
22
|
+
description: 'Clear all notifications',
|
|
23
|
+
destructive: true,
|
|
24
|
+
tags: ['notifications'],
|
|
25
|
+
})
|
|
26
|
+
addCapability({
|
|
27
|
+
id: NOTIFICATION_LIST,
|
|
28
|
+
command: NOTIFICATION_LIST,
|
|
29
|
+
description: 'List all notifications',
|
|
30
|
+
readOnly: true,
|
|
31
|
+
tags: ['notifications'],
|
|
32
|
+
})
|
|
33
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs'
|
|
2
|
+
import { registerCapabilities } from './capabilities'
|
|
3
|
+
import en from './locale/en'
|
|
4
|
+
import {
|
|
5
|
+
NotificationManager,
|
|
6
|
+
NotificationManagerOptions,
|
|
7
|
+
NOTIFICATION_CHANGED,
|
|
8
|
+
NOTIFICATION_ADDED,
|
|
9
|
+
NOTIFICATION_REMOVED,
|
|
10
|
+
NOTIFICATION_CLEARED
|
|
11
|
+
} from './NotificationManager'
|
|
12
|
+
import view from './view'
|
|
13
|
+
import { Storage } from './Storage'
|
|
14
|
+
import { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
15
|
+
|
|
16
|
+
// Re-export command IDs
|
|
17
|
+
export { NOTIFICATION_ADD, NOTIFICATION_REMOVE, NOTIFICATION_CLEAR, NOTIFICATION_LIST } from './commands'
|
|
18
|
+
|
|
19
|
+
// Events (re-exported from NotificationManager)
|
|
20
|
+
export {
|
|
21
|
+
NOTIFICATION_CHANGED,
|
|
22
|
+
NOTIFICATION_ADDED,
|
|
23
|
+
NOTIFICATION_REMOVED,
|
|
24
|
+
NOTIFICATION_CLEARED
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Types
|
|
28
|
+
export type { NotificationManagerOptions } from './NotificationManager'
|
|
29
|
+
export type { NotificationOptions } from './Notification'
|
|
30
|
+
export { Notification } from './Notification'
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create a container if needed, make it sticky and append it to the body
|
|
34
|
+
*/
|
|
35
|
+
function createDefaultContainer(container?: HTMLElement): HTMLElement {
|
|
36
|
+
if (container) return container
|
|
37
|
+
|
|
38
|
+
const el = document.createElement('ul')
|
|
39
|
+
el.style.position = 'fixed'
|
|
40
|
+
el.style.bottom = '10px'
|
|
41
|
+
el.style.zIndex = '9999'
|
|
42
|
+
document.body.appendChild(el)
|
|
43
|
+
return el
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// GrapesJS Plugin
|
|
47
|
+
export default (editor: Editor, opts: Partial<NotificationManagerOptions> = {}) => {
|
|
48
|
+
const options = {
|
|
49
|
+
i18n: {},
|
|
50
|
+
container: createDefaultContainer(opts.container),
|
|
51
|
+
storeKey: undefined,
|
|
52
|
+
maxNotifications: 50,
|
|
53
|
+
reverse: false,
|
|
54
|
+
...opts
|
|
55
|
+
} as NotificationManagerOptions
|
|
56
|
+
|
|
57
|
+
// Load i18n files
|
|
58
|
+
editor.I18n && editor.I18n.addMessages({
|
|
59
|
+
en,
|
|
60
|
+
...options.i18n,
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// Create storage if needed
|
|
64
|
+
const storage = options.storeKey ? new Storage(options.storeKey) : null
|
|
65
|
+
|
|
66
|
+
// Create notification manager
|
|
67
|
+
const notificationManager = new NotificationManager(storage?.getAll() || [], editor, options)
|
|
68
|
+
|
|
69
|
+
// Add commands
|
|
70
|
+
editor.Commands.add(NOTIFICATION_ADD, {
|
|
71
|
+
run(editor: Editor, sender: any, options: any) {
|
|
72
|
+
if (!options?.type) throw new Error('Required: type (one of: info, warning, error, success)')
|
|
73
|
+
if (!options?.message) throw new Error('Required: message (notification text)')
|
|
74
|
+
if (!['info', 'warning', 'error', 'success'].includes(options.type)) {
|
|
75
|
+
throw new Error(`Invalid type "${options.type}". Must be one of: info, warning, error, success`)
|
|
76
|
+
}
|
|
77
|
+
notificationManager.add(options)
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
editor.Commands.add(NOTIFICATION_REMOVE, {
|
|
82
|
+
run(editor: Editor, sender: any, data: any) {
|
|
83
|
+
const notification = data?.notification || data
|
|
84
|
+
notificationManager.remove(notification)
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
editor.Commands.add(NOTIFICATION_CLEAR, {
|
|
89
|
+
run(editor: Editor) {
|
|
90
|
+
notificationManager.reset()
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
editor.Commands.add(NOTIFICATION_LIST, {
|
|
95
|
+
run() {
|
|
96
|
+
return notificationManager.getAll().map(n => ({
|
|
97
|
+
type: n.type,
|
|
98
|
+
message: n.message,
|
|
99
|
+
group: n.group,
|
|
100
|
+
}))
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
// Handle notification changes
|
|
105
|
+
editor.on(NOTIFICATION_CHANGED, (notifications) => {
|
|
106
|
+
// Use the passed notifications array or get all as fallback
|
|
107
|
+
const allNotifications = notifications || notificationManager.getAll()
|
|
108
|
+
// Update storage
|
|
109
|
+
storage?.save(allNotifications)
|
|
110
|
+
// Render notifications
|
|
111
|
+
view(editor, options.container, allNotifications, options)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
// Register AI capabilities if grapesjs-ai-capabilities is loaded
|
|
115
|
+
editor.on('ai-capabilities:ready', (addCapability: (def: Record<string, unknown>) => void) => {
|
|
116
|
+
registerCapabilities(addCapability)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// Public API accessible via commands and events only
|
|
120
|
+
return {
|
|
121
|
+
getAll: () => notificationManager.getAll(),
|
|
122
|
+
add: (notification: any) => editor.runCommand(NOTIFICATION_ADD, notification),
|
|
123
|
+
remove: (notification: any) => editor.runCommand(NOTIFICATION_REMOVE, notification),
|
|
124
|
+
clear: () => editor.runCommand(NOTIFICATION_CLEAR)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { html, render as litRender, TemplateResult } from 'lit'
|
|
2
|
+
import { classMap } from 'lit-html/directives/class-map.js'
|
|
3
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
4
|
+
import { Editor } from 'grapesjs'
|
|
5
|
+
import { Notification } from './Notification'
|
|
6
|
+
import { NotificationManagerOptions } from './NotificationManager'
|
|
7
|
+
|
|
8
|
+
export default function(editor: Editor, container: HTMLElement, notifs: Notification[], options: NotificationManagerOptions): void {
|
|
9
|
+
const notifications = [...notifs]
|
|
10
|
+
|
|
11
|
+
// Reverse if options.reverse is true
|
|
12
|
+
if (options.reverse) {
|
|
13
|
+
notifications.reverse()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const organizedNotifications = organizeNotifications(notifications)
|
|
17
|
+
.slice(0, options.maxNotifications || notifications.length)
|
|
18
|
+
|
|
19
|
+
litRender(html`
|
|
20
|
+
<style>
|
|
21
|
+
.gjs-notification {
|
|
22
|
+
top: 10px;
|
|
23
|
+
right: 10px;
|
|
24
|
+
max-width: 300px;
|
|
25
|
+
z-index: 9999;
|
|
26
|
+
list-style: none;
|
|
27
|
+
padding: 10px;
|
|
28
|
+
margin: 10px;
|
|
29
|
+
font-family: var(--gjs-main-font);
|
|
30
|
+
font-size: var(--gjs-font-size);
|
|
31
|
+
max-height: 80vh;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
}
|
|
34
|
+
.gjs-notification details summary {
|
|
35
|
+
list-style: none;
|
|
36
|
+
}
|
|
37
|
+
.gjs-notification li {
|
|
38
|
+
border-radius: 5px;
|
|
39
|
+
margin: 10px 0;
|
|
40
|
+
padding: 10px;
|
|
41
|
+
list-style: none;
|
|
42
|
+
}
|
|
43
|
+
.gjs-notification ul {
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
<ul class="gjs-notification">
|
|
48
|
+
${
|
|
49
|
+
organizedNotifications
|
|
50
|
+
.map(item => typeof item === 'string' ? renderGroup(editor, options, item, notifications.filter(n => n.group === item)) : renderNotification(editor, item))
|
|
51
|
+
}
|
|
52
|
+
</ul>
|
|
53
|
+
`, getContainer(container))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function getContainer(container: HTMLElement | string): HTMLElement {
|
|
57
|
+
if (typeof container === 'string') {
|
|
58
|
+
return document.querySelector(container) as HTMLElement
|
|
59
|
+
}
|
|
60
|
+
return container
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function organizeNotifications(notifications: Notification[]): (Notification | string)[] {
|
|
64
|
+
const groups: {[key: string]: boolean} = {}
|
|
65
|
+
const organized: (Notification | string)[] = []
|
|
66
|
+
|
|
67
|
+
notifications.forEach(notification => {
|
|
68
|
+
if (notification.group && !groups[notification.group]) {
|
|
69
|
+
groups[notification.group] = true
|
|
70
|
+
organized.push(notification.group)
|
|
71
|
+
} else if (!notification.group) {
|
|
72
|
+
organized.push(notification)
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
return organized
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function renderGroup(editor: Editor, options: NotificationManagerOptions, groupName: string, groupedNotifications: Notification[]): TemplateResult {
|
|
80
|
+
return html`
|
|
81
|
+
<li class="gjs-sm gjs-one-bg gjs-two-color gjs-notification__group">
|
|
82
|
+
<details class="gjs-sm gjs-one-bg gjs-two-color">
|
|
83
|
+
<summary class="gjs-sm-header gjs-label">
|
|
84
|
+
<div>\u{1F4CC} ${groupName}</div>
|
|
85
|
+
<button @click=${() => groupedNotifications.forEach(notification => notification.remove())} class="gjs-btn-prim">${editor.I18n.t('@silexlabs/grapesjs-notifications.CloseAll')}</button>
|
|
86
|
+
<button
|
|
87
|
+
@click=${(e: any) => e.currentTarget.closest('details').toggleAttribute('open')}
|
|
88
|
+
class="gjs-btn-prim"
|
|
89
|
+
>${ editor.I18n.t('@silexlabs/grapesjs-notifications.Show') }</button>
|
|
90
|
+
</summary>
|
|
91
|
+
<ul>
|
|
92
|
+
${groupedNotifications
|
|
93
|
+
.slice(0, options.maxNotifications || groupedNotifications.length)
|
|
94
|
+
.map(notification => html`
|
|
95
|
+
${renderNotification(editor, notification)}
|
|
96
|
+
`)}
|
|
97
|
+
</ul>
|
|
98
|
+
</details>
|
|
99
|
+
</li>
|
|
100
|
+
`
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function renderNotification(editor: Editor, notification: Notification): TemplateResult {
|
|
104
|
+
return html`
|
|
105
|
+
<li class=${classMap({
|
|
106
|
+
'gjs-sm': true,
|
|
107
|
+
'gjs-one-bg': true,
|
|
108
|
+
'gjs-two-color': true,
|
|
109
|
+
'gjs-notification__item': true,
|
|
110
|
+
'gjs-notification__info': notification.type === 'info',
|
|
111
|
+
'gjs-notification__warning': notification.type === 'warning',
|
|
112
|
+
'gjs-notification__error': notification.type === 'error',
|
|
113
|
+
'gjs-notification__success': notification.type === 'success',
|
|
114
|
+
})}>
|
|
115
|
+
<header class="gjs-sm-header gjs-label">
|
|
116
|
+
<span>${notification.getSvgIcon(notification.type)}</span>
|
|
117
|
+
<span class="gjs-sm-header">${unsafeHTML(notification.message)}</span>
|
|
118
|
+
</header>
|
|
119
|
+
<footer class="gjs-sm-footer">
|
|
120
|
+
<button @click=${() => notification.remove()} class="gjs-btn-prim">${editor.I18n.t('@silexlabs/grapesjs-notifications.Close')}</button>
|
|
121
|
+
${notification.componentId ? html`
|
|
122
|
+
<button @click=${() => notification.select()} class="gjs-btn-prim">${editor.I18n.t('@silexlabs/grapesjs-notifications.Select')}</button>
|
|
123
|
+
` : ''}
|
|
124
|
+
</footer>
|
|
125
|
+
</li>
|
|
126
|
+
`
|
|
127
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2019",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"module": "esnext",
|
|
18
|
+
"moduleResolution": "bundler",
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"isolatedModules": true,
|
|
21
|
+
"noEmit": false,
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"declarationMap": true,
|
|
24
|
+
"rootDir": "./src",
|
|
25
|
+
"outDir": "dist"
|
|
26
|
+
},
|
|
27
|
+
"include": [
|
|
28
|
+
"src"
|
|
29
|
+
]
|
|
30
|
+
}
|