@peak-ai/canvas 1.4.20 → 1.4.22
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/.babelrc +14 -0
- package/.eslintcache +1 -0
- package/.eslintignore +5 -0
- package/.eslintrc.js +29 -0
- package/{GrapesjsCanvas.js → dist/GrapesjsCanvas.js} +3 -2
- package/dist/GrapesjsCanvas.js.map +1 -0
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/package.json +62 -0
- package/dist/plugins/grapejs-plugin.js +7 -0
- package/dist/plugins/grapejs-plugin.js.map +1 -0
- package/dist/plugins/helpers/custom-modal.js +2 -0
- package/dist/plugins/helpers/custom-modal.js.map +1 -0
- package/dist/plugins/helpers/query-cache-context.d.ts +18 -0
- package/dist/plugins/helpers/query-cache-context.js +2 -0
- package/dist/plugins/helpers/query-cache-context.js.map +1 -0
- package/dist/plugins/helpers/query-cache-singleton.d.ts +25 -0
- package/dist/plugins/helpers/query-cache-singleton.js +4 -0
- package/dist/plugins/helpers/query-cache-singleton.js.map +1 -0
- package/dist/plugins/helpers/query-cache-utils.d.ts +48 -0
- package/dist/plugins/helpers/query-cache-utils.js +6 -0
- package/dist/plugins/helpers/query-cache-utils.js.map +1 -0
- package/{plugins → dist/plugins}/helpers/query-details-modal.d.ts +7 -2
- package/dist/plugins/helpers/query-details-modal.js +4 -0
- package/dist/plugins/helpers/query-details-modal.js.map +1 -0
- package/dist/plugins/helpers/query-heading-formatter.d.ts +1 -0
- package/dist/plugins/helpers/query-heading-formatter.js +5 -0
- package/dist/plugins/helpers/query-heading-formatter.js.map +1 -0
- package/dist/plugins/helpers/query-loading-modal.d.ts +6 -0
- package/dist/plugins/helpers/query-loading-modal.js +2 -0
- package/dist/plugins/helpers/query-loading-modal.js.map +1 -0
- package/dist/plugins/helpers/render-components.js +10 -0
- package/dist/plugins/helpers/render-components.js.map +1 -0
- package/{plugins → dist/plugins}/helpers/styled-info-button.d.ts +2 -1
- package/dist/plugins/helpers/styled-info-button.js +6 -0
- package/dist/plugins/helpers/styled-info-button.js.map +1 -0
- package/dist/shadcn/components/icons/thinking.gif +0 -0
- package/dist/shadcn/components/ui/error-wrapper.js +2 -0
- package/dist/shadcn/components/ui/error-wrapper.js.map +1 -0
- package/dist/types/images.d.js +2 -0
- package/dist/types/images.d.js.map +1 -0
- package/package.json +45 -7
- package/scripts/build.ts +120 -0
- package/src/GrapesjsCanvas.tsx +494 -0
- package/src/constants/index.ts +25 -0
- package/src/declaration.d.ts +1 -0
- package/src/helpers/compiled-table.css +2429 -0
- package/src/helpers/css.ts +2667 -0
- package/src/helpers/date-picker.ts +807 -0
- package/src/helpers/filter-placeholder.ts +18 -0
- package/src/helpers/index.ts +13 -0
- package/src/helpers/merge-json.ts +106 -0
- package/src/index.styles.ts +58 -0
- package/src/index.ts +9 -0
- package/src/plugins/grapejs-plugin.tsx +196 -0
- package/src/plugins/helpers/custom-modal.tsx +123 -0
- package/src/plugins/helpers/data-table.tsx +300 -0
- package/src/plugins/helpers/extra.tsx +164 -0
- package/src/plugins/helpers/query-cache-context.tsx +154 -0
- package/src/plugins/helpers/query-cache-singleton.ts +176 -0
- package/src/plugins/helpers/query-cache-utils.ts +226 -0
- package/src/plugins/helpers/query-details-modal.tsx +400 -0
- package/src/plugins/helpers/query-heading-formatter.ts +24 -0
- package/src/plugins/helpers/query-loading-modal.tsx +94 -0
- package/src/plugins/helpers/render-components.tsx +1450 -0
- package/src/plugins/helpers/styled-info-button.tsx +504 -0
- package/src/public/canvas.css +42 -0
- package/src/public/components-css/table/table-output.css +2436 -0
- package/src/public/components-css/table/table.css +30 -0
- package/src/public/output.css +2465 -0
- package/src/public/table.css +135 -0
- package/src/shadcn/components/icons/AiAvatarIcon.tsx +47 -0
- package/src/shadcn/components/icons/Co_driver Expanding button copy.svg +21 -0
- package/src/shadcn/components/icons/ai-avatar.svg +7 -0
- package/src/shadcn/components/icons/thinking.gif +0 -0
- package/src/shadcn/components/ui/button.tsx +132 -0
- package/src/shadcn/components/ui/card.tsx +92 -0
- package/src/shadcn/components/ui/chart.tsx +324 -0
- package/src/shadcn/components/ui/checkbox.tsx +27 -0
- package/src/shadcn/components/ui/component-wrapper.tsx +61 -0
- package/src/shadcn/components/ui/date-filter.tsx +816 -0
- package/src/shadcn/components/ui/error-container.tsx +125 -0
- package/src/shadcn/components/ui/error-wrapper.tsx +99 -0
- package/src/shadcn/components/ui/filter.tsx +368 -0
- package/src/shadcn/components/ui/hover-card.tsx +36 -0
- package/src/shadcn/components/ui/input.tsx +20 -0
- package/src/shadcn/components/ui/label.tsx +24 -0
- package/src/shadcn/components/ui/pagination.tsx +213 -0
- package/src/shadcn/components/ui/scroll-area.tsx +59 -0
- package/src/shadcn/components/ui/search.tsx +150 -0
- package/src/shadcn/components/ui/separator.tsx +26 -0
- package/src/shadcn/components/ui/skeleton.tsx +69 -0
- package/src/shadcn/components/ui/table.tsx +196 -0
- package/src/shadcn/components/ui/tabs.tsx +55 -0
- package/src/shadcn/components/ui/textarea.tsx +18 -0
- package/src/shadcn/components/ui/tooltip.tsx +87 -0
- package/src/shadcn/utils.ts +6 -0
- package/src/types/grapesjs-tailwind.d.ts +61 -0
- package/src/types/images.d.ts +1 -0
- package/tailwind.config.js +5 -0
- package/tooling/tailwind-compiler/index.js +99 -0
- package/tooling/tailwind-compiler/package.json +11 -0
- package/tooling/tailwind-compiler/yarn.lock +123 -0
- package/tsconfig.build.json +15 -0
- package/tsconfig.json +8 -0
- package/GrapesjsCanvas.js.map +0 -1
- package/plugins/grapejs-plugin.js +0 -7
- package/plugins/grapejs-plugin.js.map +0 -1
- package/plugins/helpers/custom-modal.js +0 -2
- package/plugins/helpers/custom-modal.js.map +0 -1
- package/plugins/helpers/query-details-modal.js +0 -4
- package/plugins/helpers/query-details-modal.js.map +0 -1
- package/plugins/helpers/query-loading-modal.d.ts +0 -5
- package/plugins/helpers/query-loading-modal.js +0 -2
- package/plugins/helpers/query-loading-modal.js.map +0 -1
- package/plugins/helpers/render-components.js +0 -10
- package/plugins/helpers/render-components.js.map +0 -1
- package/plugins/helpers/styled-info-button.js +0 -2
- package/plugins/helpers/styled-info-button.js.map +0 -1
- package/shadcn/components/ui/error-wrapper.js +0 -2
- package/shadcn/components/ui/error-wrapper.js.map +0 -1
- /package/{GrapesjsCanvas.d.ts → dist/GrapesjsCanvas.d.ts} +0 -0
- /package/{constants → dist/constants}/index.d.ts +0 -0
- /package/{constants → dist/constants}/index.js +0 -0
- /package/{constants → dist/constants}/index.js.map +0 -0
- /package/{helpers → dist/helpers}/compiled-table.css +0 -0
- /package/{helpers → dist/helpers}/css.d.ts +0 -0
- /package/{helpers → dist/helpers}/css.js +0 -0
- /package/{helpers → dist/helpers}/css.js.map +0 -0
- /package/{helpers → dist/helpers}/date-picker.d.ts +0 -0
- /package/{helpers → dist/helpers}/date-picker.js +0 -0
- /package/{helpers → dist/helpers}/date-picker.js.map +0 -0
- /package/{helpers → dist/helpers}/filter-placeholder.d.ts +0 -0
- /package/{helpers → dist/helpers}/filter-placeholder.js +0 -0
- /package/{helpers → dist/helpers}/filter-placeholder.js.map +0 -0
- /package/{helpers → dist/helpers}/index.d.ts +0 -0
- /package/{helpers → dist/helpers}/index.js +0 -0
- /package/{helpers → dist/helpers}/index.js.map +0 -0
- /package/{helpers → dist/helpers}/merge-json.d.ts +0 -0
- /package/{helpers → dist/helpers}/merge-json.js +0 -0
- /package/{helpers → dist/helpers}/merge-json.js.map +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{index.js.map → dist/index.js.map} +0 -0
- /package/{index.styles.d.ts → dist/index.styles.d.ts} +0 -0
- /package/{index.styles.js → dist/index.styles.js} +0 -0
- /package/{index.styles.js.map → dist/index.styles.js.map} +0 -0
- /package/{plugins → dist/plugins}/grapejs-plugin.d.ts +0 -0
- /package/{plugins → dist/plugins}/helpers/custom-modal.d.ts +0 -0
- /package/{plugins → dist/plugins}/helpers/data-table.d.ts +0 -0
- /package/{plugins → dist/plugins}/helpers/data-table.js +0 -0
- /package/{plugins → dist/plugins}/helpers/data-table.js.map +0 -0
- /package/{plugins → dist/plugins}/helpers/extra.d.ts +0 -0
- /package/{plugins → dist/plugins}/helpers/extra.js +0 -0
- /package/{plugins → dist/plugins}/helpers/extra.js.map +0 -0
- /package/{plugins → dist/plugins}/helpers/render-components.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.js +0 -0
- /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/button.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/button.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/button.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/card.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/card.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/card.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/chart.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/chart.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/chart.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/checkbox.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/checkbox.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/checkbox.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/date-filter.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/date-filter.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/date-filter.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/error-container.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/error-container.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/error-container.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/error-wrapper.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/filter.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/filter.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/filter.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/hover-card.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/hover-card.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/hover-card.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/input.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/input.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/input.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/label.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/label.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/label.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/pagination.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/pagination.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/pagination.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/scroll-area.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/scroll-area.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/scroll-area.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/search.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/search.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/search.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/separator.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/separator.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/separator.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/skeleton.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/skeleton.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/skeleton.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/table.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/table.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/table.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tabs.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tabs.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tabs.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/textarea.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/textarea.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/textarea.js.map +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tooltip.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tooltip.js +0 -0
- /package/{shadcn → dist/shadcn}/components/ui/tooltip.js.map +0 -0
- /package/{shadcn → dist/shadcn}/utils.d.ts +0 -0
- /package/{shadcn → dist/shadcn}/utils.js +0 -0
- /package/{shadcn → dist/shadcn}/utils.js.map +0 -0
- /package/{types → dist/types}/grapesjs-tailwind.d.js +0 -0
- /package/{types → dist/types}/grapesjs-tailwind.d.js.map +0 -0
package/.babelrc
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
"@babel/preset-typescript",
|
|
4
|
+
["@babel/preset-react", { "runtime": "automatic" }],
|
|
5
|
+
["@babel/preset-env", { "modules": false, "loose": true }]
|
|
6
|
+
],
|
|
7
|
+
"plugins": [
|
|
8
|
+
"babel-plugin-styled-components",
|
|
9
|
+
["@babel/plugin-transform-class-properties", { "loose": true }],
|
|
10
|
+
["@babel/plugin-transform-private-methods", { "loose": true }],
|
|
11
|
+
["@babel/plugin-transform-private-property-in-object", { "loose": true }],
|
|
12
|
+
"@babel/plugin-transform-runtime"
|
|
13
|
+
]
|
|
14
|
+
}
|
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/GrapesjsCanvas.tsx":"1","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/constants/index.ts":"2","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/css.ts":"3","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/index.ts":"4","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/merge-json.ts":"5","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/index.styles.ts":"6","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/index.ts":"7","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/grapejs-plugin.tsx":"8","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/helpers/extra.tsx":"9","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/helpers/render-components.tsx":"10","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/button.tsx":"11","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/card.tsx":"12","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/chart.tsx":"13","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/checkbox.tsx":"14","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/filter.tsx":"15","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/hover-card.tsx":"16","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/input.tsx":"17","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/label.tsx":"18","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/pagination.tsx":"19","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/scroll-area.tsx":"20","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/search.tsx":"21","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/separator.tsx":"22","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/skeleton.tsx":"23","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/table.tsx":"24","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/tabs.tsx":"25","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/textarea.tsx":"26","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/tooltip.tsx":"27","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/utils.ts":"28","/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/types/grapesjs-tailwind.d.ts":"29"},{"size":7355,"mtime":1753443857826,"results":"30","hashOfConfig":"31"},{"size":973,"mtime":1751360531398,"results":"32","hashOfConfig":"31"},{"size":54814,"mtime":1753443857827,"results":"33","hashOfConfig":"31"},{"size":332,"mtime":1753167131880,"results":"34","hashOfConfig":"31"},{"size":2609,"mtime":1753756233105,"results":"35","hashOfConfig":"31"},{"size":1068,"mtime":1753167131886,"results":"36","hashOfConfig":"31"},{"size":150,"mtime":1751455501604,"results":"37","hashOfConfig":"31"},{"size":4295,"mtime":1753167131887,"results":"38","hashOfConfig":"31"},{"size":4501,"mtime":1753167131895,"results":"39","hashOfConfig":"31"},{"size":26698,"mtime":1753758002501,"results":"40","hashOfConfig":"31"},{"size":3354,"mtime":1753756233106,"results":"41","hashOfConfig":"31"},{"size":2276,"mtime":1753343048897,"results":"42","hashOfConfig":"31"},{"size":9817,"mtime":1751360531401,"results":"43","hashOfConfig":"31"},{"size":1215,"mtime":1751360531401,"results":"44","hashOfConfig":"31"},{"size":9236,"mtime":1753756233106,"results":"45","hashOfConfig":"31"},{"size":1512,"mtime":1751360531401,"results":"46","hashOfConfig":"31"},{"size":883,"mtime":1753756233106,"results":"47","hashOfConfig":"31"},{"size":679,"mtime":1751360531401,"results":"48","hashOfConfig":"31"},{"size":5097,"mtime":1753443857829,"results":"49","hashOfConfig":"31"},{"size":1800,"mtime":1753756230301,"results":"50","hashOfConfig":"31"},{"size":4726,"mtime":1753756233107,"results":"51","hashOfConfig":"31"},{"size":713,"mtime":1751360531402,"results":"52","hashOfConfig":"31"},{"size":1895,"mtime":1751455501606,"results":"53","hashOfConfig":"31"},{"size":2309,"mtime":1753756174602,"results":"54","hashOfConfig":"31"},{"size":1902,"mtime":1751360531402,"results":"55","hashOfConfig":"31"},{"size":764,"mtime":1751360531402,"results":"56","hashOfConfig":"31"},{"size":2607,"mtime":1753756233107,"results":"57","hashOfConfig":"31"},{"size":164,"mtime":1751360531402,"results":"58","hashOfConfig":"31"},{"size":915,"mtime":1751360531403,"results":"59","hashOfConfig":"31"},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"rbghib",{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","suppressedMessages":"77","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","suppressedMessages":"80","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","suppressedMessages":"83","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","suppressedMessages":"86","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","suppressedMessages":"89","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","suppressedMessages":"92","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","suppressedMessages":"95","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"99","messages":"100","suppressedMessages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","suppressedMessages":"119","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","suppressedMessages":"128","errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"129","messages":"130","suppressedMessages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","suppressedMessages":"134","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","suppressedMessages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","suppressedMessages":"140","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/GrapesjsCanvas.tsx",[],["147","148","149","150","151","152","153","154","155","156"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/constants/index.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/css.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/index.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/helpers/merge-json.ts",[],["157","158","159","160","161","162","163","164"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/index.styles.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/index.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/grapejs-plugin.tsx",[],["165","166","167","168","169","170","171","172","173","174","175","176"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/helpers/extra.tsx",[],["177","178","179","180","181","182","183"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/plugins/helpers/render-components.tsx",[],["184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200","201","202","203","204","205","206"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/button.tsx",[],["207"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/card.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/chart.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/checkbox.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/filter.tsx",[],["208","209"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/hover-card.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/input.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/label.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/pagination.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/scroll-area.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/search.tsx",[],["210","211"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/separator.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/skeleton.tsx",["212"],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/table.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/tabs.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/textarea.tsx",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/components/ui/tooltip.tsx",[],["213","214"],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/shadcn/utils.ts",[],[],"/Users/chahat.singla/Desktop/table/canvas-ui-toolkit/packages/canvas/src/types/grapesjs-tailwind.d.ts",[],["215","216","217","218","219"],{"ruleId":"220","severity":1,"message":"221","line":4,"column":8,"nodeType":"222","endLine":4,"endColumn":16,"suppressions":"223"},{"ruleId":"224","severity":2,"message":"225","line":14,"column":9,"nodeType":"226","messageId":"227","endLine":14,"endColumn":12,"suggestions":"228","suppressions":"229"},{"ruleId":"224","severity":2,"message":"225","line":17,"column":48,"nodeType":"226","messageId":"227","endLine":17,"endColumn":51,"suggestions":"230","suppressions":"231"},{"ruleId":"224","severity":2,"message":"225","line":17,"column":80,"nodeType":"226","messageId":"227","endLine":17,"endColumn":83,"suggestions":"232","suppressions":"233"},{"ruleId":"224","severity":2,"message":"225","line":55,"column":37,"nodeType":"226","messageId":"227","endLine":55,"endColumn":40,"suggestions":"234","suppressions":"235"},{"ruleId":"224","severity":2,"message":"225","line":70,"column":30,"nodeType":"226","messageId":"227","endLine":70,"endColumn":33,"suggestions":"236","suppressions":"237"},{"ruleId":"224","severity":2,"message":"225","line":70,"column":36,"nodeType":"226","messageId":"227","endLine":70,"endColumn":39,"suggestions":"238","suppressions":"239"},{"ruleId":"224","severity":2,"message":"225","line":84,"column":40,"nodeType":"226","messageId":"227","endLine":84,"endColumn":43,"suggestions":"240","suppressions":"241"},{"ruleId":"224","severity":2,"message":"225","line":143,"column":33,"nodeType":"226","messageId":"227","endLine":143,"endColumn":36,"suggestions":"242","suppressions":"243"},{"ruleId":"224","severity":2,"message":"225","line":146,"column":68,"nodeType":"226","messageId":"227","endLine":146,"endColumn":71,"suggestions":"244","suppressions":"245"},{"ruleId":"224","severity":2,"message":"225","line":2,"column":44,"nodeType":"226","messageId":"227","endLine":2,"endColumn":47,"suggestions":"246","suppressions":"247"},{"ruleId":"224","severity":2,"message":"225","line":7,"column":24,"nodeType":"226","messageId":"227","endLine":7,"endColumn":27,"suggestions":"248","suppressions":"249"},{"ruleId":"224","severity":2,"message":"225","line":8,"column":27,"nodeType":"226","messageId":"227","endLine":8,"endColumn":30,"suggestions":"250","suppressions":"251"},{"ruleId":"224","severity":2,"message":"225","line":38,"column":24,"nodeType":"226","messageId":"227","endLine":38,"endColumn":27,"suggestions":"252","suppressions":"253"},{"ruleId":"224","severity":2,"message":"225","line":39,"column":27,"nodeType":"226","messageId":"227","endLine":39,"endColumn":30,"suggestions":"254","suppressions":"255"},{"ruleId":"224","severity":2,"message":"225","line":40,"column":19,"nodeType":"226","messageId":"227","endLine":40,"endColumn":22,"suggestions":"256","suppressions":"257"},{"ruleId":"224","severity":2,"message":"225","line":88,"column":57,"nodeType":"226","messageId":"227","endLine":88,"endColumn":60,"suggestions":"258","suppressions":"259"},{"ruleId":"224","severity":2,"message":"225","line":88,"column":89,"nodeType":"226","messageId":"227","endLine":88,"endColumn":92,"suggestions":"260","suppressions":"261"},{"ruleId":"224","severity":2,"message":"225","line":10,"column":48,"nodeType":"226","messageId":"227","endLine":10,"endColumn":51,"suggestions":"262","suppressions":"263"},{"ruleId":"224","severity":2,"message":"225","line":27,"column":14,"nodeType":"226","messageId":"227","endLine":27,"endColumn":17,"suggestions":"264","suppressions":"265"},{"ruleId":"266","severity":2,"message":"267","line":60,"column":9,"nodeType":"268","messageId":"269","endLine":60,"endColumn":26,"suppressions":"270"},{"ruleId":"224","severity":2,"message":"225","line":62,"column":26,"nodeType":"226","messageId":"227","endLine":62,"endColumn":29,"suggestions":"271","suppressions":"272"},{"ruleId":"273","severity":2,"message":"274","line":69,"column":15,"nodeType":"275","messageId":"276","endLine":69,"endColumn":28,"suggestions":"277","suppressions":"278"},{"ruleId":"224","severity":2,"message":"225","line":77,"column":54,"nodeType":"226","messageId":"227","endLine":77,"endColumn":57,"suggestions":"279","suppressions":"280"},{"ruleId":"281","severity":1,"message":"282","line":89,"column":15,"nodeType":"275","endLine":89,"endColumn":30,"suppressions":"283"},{"ruleId":"281","severity":1,"message":"282","line":102,"column":15,"nodeType":"275","endLine":102,"endColumn":30,"suppressions":"284"},{"ruleId":"224","severity":2,"message":"225","line":112,"column":27,"nodeType":"226","messageId":"227","endLine":112,"endColumn":30,"suggestions":"285","suppressions":"286"},{"ruleId":"273","severity":2,"message":"274","line":117,"column":13,"nodeType":"275","messageId":"276","endLine":117,"endColumn":25,"suggestions":"287","suppressions":"288"},{"ruleId":"266","severity":2,"message":"289","line":130,"column":9,"nodeType":"268","messageId":"269","endLine":130,"endColumn":26,"suppressions":"290"},{"ruleId":"281","severity":1,"message":"291","line":132,"column":11,"nodeType":"275","endLine":132,"endColumn":42,"suppressions":"292"},{"ruleId":"224","severity":2,"message":"225","line":17,"column":39,"nodeType":"226","messageId":"227","endLine":17,"endColumn":42,"suggestions":"293","suppressions":"294"},{"ruleId":"224","severity":2,"message":"225","line":34,"column":40,"nodeType":"226","messageId":"227","endLine":34,"endColumn":43,"suggestions":"295","suppressions":"296"},{"ruleId":"224","severity":2,"message":"225","line":61,"column":36,"nodeType":"226","messageId":"227","endLine":61,"endColumn":39,"suggestions":"297","suppressions":"298"},{"ruleId":"224","severity":2,"message":"225","line":85,"column":36,"nodeType":"226","messageId":"227","endLine":85,"endColumn":39,"suggestions":"299","suppressions":"300"},{"ruleId":"224","severity":2,"message":"225","line":97,"column":40,"nodeType":"226","messageId":"227","endLine":97,"endColumn":43,"suggestions":"301","suppressions":"302"},{"ruleId":"224","severity":2,"message":"225","line":105,"column":39,"nodeType":"226","messageId":"227","endLine":105,"endColumn":42,"suggestions":"303","suppressions":"304"},{"ruleId":"224","severity":2,"message":"225","line":129,"column":38,"nodeType":"226","messageId":"227","endLine":129,"endColumn":41,"suggestions":"305","suppressions":"306"},{"ruleId":"224","severity":2,"message":"225","line":99,"column":41,"nodeType":"226","messageId":"227","endLine":99,"endColumn":44,"suggestions":"307","suppressions":"308"},{"ruleId":"224","severity":2,"message":"225","line":153,"column":35,"nodeType":"226","messageId":"227","endLine":153,"endColumn":38,"suggestions":"309","suppressions":"310"},{"ruleId":"224","severity":2,"message":"225","line":259,"column":56,"nodeType":"226","messageId":"227","endLine":259,"endColumn":59,"suggestions":"311","suppressions":"312"},{"ruleId":"224","severity":2,"message":"225","line":259,"column":69,"nodeType":"226","messageId":"227","endLine":259,"endColumn":72,"suggestions":"313","suppressions":"314"},{"ruleId":"224","severity":2,"message":"225","line":350,"column":36,"nodeType":"226","messageId":"227","endLine":350,"endColumn":39,"suggestions":"315","suppressions":"316"},{"ruleId":"317","severity":2,"message":"318","line":381,"column":11,"nodeType":"319","messageId":"320","endLine":385,"endColumn":6,"suppressions":"321"},{"ruleId":"224","severity":2,"message":"225","line":486,"column":29,"nodeType":"226","messageId":"227","endLine":486,"endColumn":32,"suggestions":"322","suppressions":"323"},{"ruleId":"224","severity":2,"message":"225","line":515,"column":36,"nodeType":"226","messageId":"227","endLine":515,"endColumn":39,"suggestions":"324","suppressions":"325"},{"ruleId":"326","severity":2,"message":"327","line":516,"column":48,"nodeType":"328","messageId":"276","endLine":516,"endColumn":50,"suppressions":"329"},{"ruleId":"224","severity":2,"message":"225","line":565,"column":39,"nodeType":"226","messageId":"227","endLine":565,"endColumn":42,"suggestions":"330","suppressions":"331"},{"ruleId":"224","severity":2,"message":"225","line":595,"column":39,"nodeType":"226","messageId":"227","endLine":595,"endColumn":42,"suggestions":"332","suppressions":"333"},{"ruleId":"224","severity":2,"message":"225","line":600,"column":77,"nodeType":"226","messageId":"227","endLine":600,"endColumn":80,"suggestions":"334","suppressions":"335"},{"ruleId":"224","severity":2,"message":"225","line":651,"column":25,"nodeType":"226","messageId":"227","endLine":651,"endColumn":28,"suggestions":"336","suppressions":"337"},{"ruleId":"224","severity":2,"message":"225","line":727,"column":43,"nodeType":"226","messageId":"227","endLine":727,"endColumn":46,"suggestions":"338","suppressions":"339"},{"ruleId":"224","severity":2,"message":"225","line":772,"column":34,"nodeType":"226","messageId":"227","endLine":772,"endColumn":37,"suggestions":"340","suppressions":"341"},{"ruleId":"224","severity":2,"message":"225","line":797,"column":39,"nodeType":"226","messageId":"227","endLine":797,"endColumn":42,"suggestions":"342","suppressions":"343"},{"ruleId":"317","severity":2,"message":"318","line":827,"column":9,"nodeType":"319","messageId":"320","endLine":832,"endColumn":4,"suppressions":"344"},{"ruleId":"317","severity":2,"message":"318","line":834,"column":9,"nodeType":"319","messageId":"320","endLine":843,"endColumn":4,"suppressions":"345"},{"ruleId":"317","severity":2,"message":"318","line":846,"column":9,"nodeType":"319","messageId":"320","endLine":858,"endColumn":4,"suppressions":"346"},{"ruleId":"224","severity":2,"message":"225","line":852,"column":38,"nodeType":"226","messageId":"227","endLine":852,"endColumn":41,"suggestions":"347","suppressions":"348"},{"ruleId":"224","severity":2,"message":"225","line":911,"column":37,"nodeType":"226","messageId":"227","endLine":911,"endColumn":40,"suggestions":"349","suppressions":"350"},{"ruleId":"326","severity":2,"message":"327","line":912,"column":68,"nodeType":"328","messageId":"276","endLine":912,"endColumn":70,"suppressions":"351"},{"ruleId":"224","severity":2,"message":"225","line":972,"column":56,"nodeType":"226","messageId":"227","endLine":972,"endColumn":59,"suggestions":"352","suppressions":"353"},{"ruleId":"224","severity":2,"message":"225","line":59,"column":31,"nodeType":"226","messageId":"227","endLine":59,"endColumn":34,"suggestions":"354","suppressions":"355"},{"ruleId":"224","severity":2,"message":"225","line":17,"column":13,"nodeType":"226","messageId":"227","endLine":17,"endColumn":16,"suggestions":"356","suppressions":"357"},{"ruleId":"224","severity":2,"message":"225","line":18,"column":48,"nodeType":"226","messageId":"227","endLine":18,"endColumn":51,"suggestions":"358","suppressions":"359"},{"ruleId":"224","severity":2,"message":"225","line":13,"column":13,"nodeType":"226","messageId":"227","endLine":13,"endColumn":16,"suggestions":"360","suppressions":"361"},{"ruleId":"224","severity":2,"message":"225","line":14,"column":48,"nodeType":"226","messageId":"227","endLine":14,"endColumn":51,"suggestions":"362","suppressions":"363"},{"ruleId":"364","severity":2,"message":"365","line":21,"column":51,"nodeType":"366","messageId":"367","endLine":21,"endColumn":52},{"ruleId":"224","severity":2,"message":"225","line":46,"column":20,"nodeType":"226","messageId":"227","endLine":46,"endColumn":23,"suggestions":"368","suppressions":"369"},{"ruleId":"224","severity":2,"message":"225","line":46,"column":56,"nodeType":"226","messageId":"227","endLine":46,"endColumn":59,"suggestions":"370","suppressions":"371"},{"ruleId":"224","severity":2,"message":"225","line":14,"column":17,"nodeType":"226","messageId":"227","endLine":14,"endColumn":20,"suggestions":"372","suppressions":"373"},{"ruleId":"224","severity":2,"message":"225","line":15,"column":17,"nodeType":"226","messageId":"227","endLine":15,"endColumn":20,"suggestions":"374","suppressions":"375"},{"ruleId":"224","severity":2,"message":"225","line":16,"column":30,"nodeType":"226","messageId":"227","endLine":16,"endColumn":33,"suggestions":"376","suppressions":"377"},{"ruleId":"224","severity":2,"message":"225","line":17,"column":33,"nodeType":"226","messageId":"227","endLine":17,"endColumn":36,"suggestions":"378","suppressions":"379"},{"ruleId":"380","severity":2,"message":"381","line":31,"column":17,"nodeType":"319","messageId":"382","endLine":31,"endColumn":66,"suppressions":"383"},"import/no-named-as-default","Using exported name 'grapesjs' as identifier for default import.","ImportDefaultSpecifier",["384"],"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["385","386"],["387"],["388","389"],["390"],["391","392"],["393"],["394","395"],["396"],["397","398"],["399"],["400","401"],["402"],["403","404"],["405"],["406","407"],["408"],["409","410"],["411"],["412","413"],["414"],["415","416"],["417"],["418","419"],["420"],["421","422"],["423"],["424","425"],["426"],["427","428"],["429"],["430","431"],["432"],["433","434"],["435"],["436","437"],["438"],["439","440"],["441"],"func-names","Unexpected unnamed method 'render'.","FunctionExpression","unnamed",["442"],["443","444"],["445"],"no-console","Unexpected console statement.","MemberExpression","unexpected",["446"],["447"],["448","449"],["450"],"import/no-named-as-default-member","Caution: `ReactDOM` also has a named export `render`. Check if you meant to write `import {render} from 'react-dom'` instead.",["451"],["452"],["453","454"],["455"],["456"],["457"],"Unexpected unnamed method 'remove'.",["458"],"Caution: `ReactDOM` also has a named export `unmountComponentAtNode`. Check if you meant to write `import {unmountComponentAtNode} from 'react-dom'` instead.",["459","460"],["461","462"],["463"],["464","465"],["466"],["467","468"],["469"],["470","471"],["472"],["473","474"],["475"],["476","477"],["478"],["479","480"],["481"],["482","483"],["484"],["485","486"],["487"],["488","489"],["490"],["491","492"],["493"],["494","495"],["496"],"func-style","Expected a function declaration.","VariableDeclarator","declaration",["497"],["498","499"],["500"],["501","502"],["503"],"@typescript-eslint/no-empty-function","Unexpected empty arrow function.","ArrowFunctionExpression",["504"],["505","506"],["507"],["508","509"],["510"],["511","512"],["513"],["514","515"],["516"],["517","518"],["519"],["520","521"],["522"],["523","524"],["525"],["526"],["527"],["528"],["529","530"],["531"],["532","533"],["534"],["535"],["536","537"],["538"],["539","540"],["541"],["542","543"],["544"],["545","546"],["547"],["548","549"],["550"],["551","552"],["553"],"@typescript-eslint/no-shadow","'_' is already declared in the upper scope on line 17 column 40.","Identifier","noShadow",["554","555"],["556"],["557","558"],["559"],["560","561"],["562"],["563","564"],["565"],["566","567"],["568"],["569","570"],["571"],"init-declarations","Variable 'grapesjsTailwind' should be initialized on declaration.","initialized",["572"],{"kind":"573","justification":"574"},{"messageId":"575","fix":"576","desc":"577"},{"messageId":"578","fix":"579","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"581","desc":"577"},{"messageId":"578","fix":"582","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"583","desc":"577"},{"messageId":"578","fix":"584","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"585","desc":"577"},{"messageId":"578","fix":"586","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"587","desc":"577"},{"messageId":"578","fix":"588","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"589","desc":"577"},{"messageId":"578","fix":"590","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"591","desc":"577"},{"messageId":"578","fix":"592","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"593","desc":"577"},{"messageId":"578","fix":"594","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"595","desc":"577"},{"messageId":"578","fix":"596","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"597","desc":"577"},{"messageId":"578","fix":"598","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"599","desc":"577"},{"messageId":"578","fix":"600","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"601","desc":"577"},{"messageId":"578","fix":"602","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"603","desc":"577"},{"messageId":"578","fix":"604","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"605","desc":"577"},{"messageId":"578","fix":"606","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"607","desc":"577"},{"messageId":"578","fix":"608","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"609","desc":"577"},{"messageId":"578","fix":"610","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"611","desc":"577"},{"messageId":"578","fix":"612","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"613","desc":"577"},{"messageId":"578","fix":"614","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"615","desc":"577"},{"messageId":"578","fix":"616","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"617","desc":"577"},{"messageId":"578","fix":"618","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"619","data":"620","fix":"621","desc":"622"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"623","desc":"577"},{"messageId":"578","fix":"624","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"625","desc":"577"},{"messageId":"578","fix":"626","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"619","data":"627","fix":"628","desc":"629"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"630","desc":"577"},{"messageId":"578","fix":"631","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"632","desc":"577"},{"messageId":"578","fix":"633","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"634","desc":"577"},{"messageId":"578","fix":"635","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"636","desc":"577"},{"messageId":"578","fix":"637","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"638","desc":"577"},{"messageId":"578","fix":"639","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"640","desc":"577"},{"messageId":"578","fix":"641","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"642","desc":"577"},{"messageId":"578","fix":"643","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"644","desc":"577"},{"messageId":"578","fix":"645","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"646","desc":"577"},{"messageId":"578","fix":"647","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"648","desc":"577"},{"messageId":"578","fix":"649","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"650","desc":"577"},{"messageId":"578","fix":"651","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"652","desc":"577"},{"messageId":"578","fix":"653","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"654","desc":"577"},{"messageId":"578","fix":"655","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"656","desc":"577"},{"messageId":"578","fix":"657","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"658","desc":"577"},{"messageId":"578","fix":"659","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"660","desc":"577"},{"messageId":"578","fix":"661","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"662","desc":"577"},{"messageId":"578","fix":"663","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"664","desc":"577"},{"messageId":"578","fix":"665","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"666","desc":"577"},{"messageId":"578","fix":"667","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"668","desc":"577"},{"messageId":"578","fix":"669","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"670","desc":"577"},{"messageId":"578","fix":"671","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"672","desc":"577"},{"messageId":"578","fix":"673","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"674","desc":"577"},{"messageId":"578","fix":"675","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"676","desc":"577"},{"messageId":"578","fix":"677","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"678","desc":"577"},{"messageId":"578","fix":"679","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"680","desc":"577"},{"messageId":"578","fix":"681","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"682","desc":"577"},{"messageId":"578","fix":"683","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"684","desc":"577"},{"messageId":"578","fix":"685","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"686","desc":"577"},{"messageId":"578","fix":"687","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"688","desc":"577"},{"messageId":"578","fix":"689","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"690","desc":"577"},{"messageId":"578","fix":"691","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"692","desc":"577"},{"messageId":"578","fix":"693","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"694","desc":"577"},{"messageId":"578","fix":"695","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"696","desc":"577"},{"messageId":"578","fix":"697","desc":"580"},{"kind":"573","justification":"574"},{"messageId":"575","fix":"698","desc":"577"},{"messageId":"578","fix":"699","desc":"580"},{"kind":"573","justification":"574"},{"kind":"573","justification":"574"},"directive","","suggestUnknown",{"range":"700","text":"701"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"702","text":"703"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",{"range":"704","text":"701"},{"range":"705","text":"703"},{"range":"706","text":"701"},{"range":"707","text":"703"},{"range":"708","text":"701"},{"range":"709","text":"703"},{"range":"710","text":"701"},{"range":"711","text":"703"},{"range":"712","text":"701"},{"range":"713","text":"703"},{"range":"714","text":"701"},{"range":"715","text":"703"},{"range":"716","text":"701"},{"range":"717","text":"703"},{"range":"718","text":"701"},{"range":"719","text":"703"},{"range":"720","text":"701"},{"range":"721","text":"703"},{"range":"722","text":"701"},{"range":"723","text":"703"},{"range":"724","text":"701"},{"range":"725","text":"703"},{"range":"726","text":"701"},{"range":"727","text":"703"},{"range":"728","text":"701"},{"range":"729","text":"703"},{"range":"730","text":"701"},{"range":"731","text":"703"},{"range":"732","text":"701"},{"range":"733","text":"703"},{"range":"734","text":"701"},{"range":"735","text":"703"},{"range":"736","text":"701"},{"range":"737","text":"703"},{"range":"738","text":"701"},{"range":"739","text":"703"},{"range":"740","text":"701"},{"range":"741","text":"703"},"removeConsole",{"propertyName":"742"},{"range":"743","text":"574"},"Remove the console.error().",{"range":"744","text":"701"},{"range":"745","text":"703"},{"range":"746","text":"701"},{"range":"747","text":"703"},{"propertyName":"748"},{"range":"749","text":"574"},"Remove the console.warn().",{"range":"750","text":"701"},{"range":"751","text":"703"},{"range":"752","text":"701"},{"range":"753","text":"703"},{"range":"754","text":"701"},{"range":"755","text":"703"},{"range":"756","text":"701"},{"range":"757","text":"703"},{"range":"758","text":"701"},{"range":"759","text":"703"},{"range":"760","text":"701"},{"range":"761","text":"703"},{"range":"762","text":"701"},{"range":"763","text":"703"},{"range":"764","text":"701"},{"range":"765","text":"703"},{"range":"766","text":"701"},{"range":"767","text":"703"},{"range":"768","text":"701"},{"range":"769","text":"703"},{"range":"770","text":"701"},{"range":"771","text":"703"},{"range":"772","text":"701"},{"range":"773","text":"703"},{"range":"774","text":"701"},{"range":"775","text":"703"},{"range":"776","text":"701"},{"range":"777","text":"703"},{"range":"778","text":"701"},{"range":"779","text":"703"},{"range":"780","text":"701"},{"range":"781","text":"703"},{"range":"782","text":"701"},{"range":"783","text":"703"},{"range":"784","text":"701"},{"range":"785","text":"703"},{"range":"786","text":"701"},{"range":"787","text":"703"},{"range":"788","text":"701"},{"range":"789","text":"703"},{"range":"790","text":"701"},{"range":"791","text":"703"},{"range":"792","text":"701"},{"range":"793","text":"703"},{"range":"794","text":"701"},{"range":"795","text":"703"},{"range":"796","text":"701"},{"range":"797","text":"703"},{"range":"798","text":"701"},{"range":"799","text":"703"},{"range":"800","text":"701"},{"range":"801","text":"703"},{"range":"802","text":"701"},{"range":"803","text":"703"},{"range":"804","text":"701"},{"range":"805","text":"703"},{"range":"806","text":"701"},{"range":"807","text":"703"},{"range":"808","text":"701"},{"range":"809","text":"703"},{"range":"810","text":"701"},{"range":"811","text":"703"},{"range":"812","text":"701"},{"range":"813","text":"703"},{"range":"814","text":"701"},{"range":"815","text":"703"},{"range":"816","text":"701"},{"range":"817","text":"703"},{"range":"818","text":"701"},{"range":"819","text":"703"},[606,609],"unknown",[606,609],"never",[728,731],[728,731],[760,763],[760,763],[1770,1773],[1770,1773],[2197,2200],[2197,2200],[2203,2206],[2203,2206],[2606,2609],[2606,2609],[3905,3908],[3905,3908],[4045,4048],[4045,4048],[99,102],[99,102],[250,253],[250,253],[282,285],[282,285],[1066,1069],[1066,1069],[1098,1101],[1098,1101],[1122,1125],[1122,1125],[2277,2280],[2277,2280],[2309,2312],[2309,2312],[412,415],[412,415],[897,900],[897,900],[1864,1867],[1864,1867],"error",[2114,2167],[2392,2395],[2392,2395],[3582,3585],[3582,3585],"warn",[3780,3849],[680,683],[680,683],[1221,1224],[1221,1224],[1991,1994],[1991,1994],[2614,2617],[2614,2617],[3016,3019],[3016,3019],[3292,3295],[3292,3295],[3920,3923],[3920,3923],[2653,2656],[2653,2656],[4104,4107],[4104,4107],[6959,6962],[6959,6962],[6972,6975],[6972,6975],[9751,9754],[9751,9754],[13625,13628],[13625,13628],[14304,14307],[14304,14307],[15472,15475],[15472,15475],[16086,16089],[16086,16089],[16336,16339],[16336,16339],[17791,17794],[17791,17794],[20233,20236],[20233,20236],[21628,21631],[21628,21631],[22277,22280],[22277,22280],[23440,23443],[23440,23443],[25137,25140],[25137,25140],[26422,26425],[26422,26425],[2267,2270],[2267,2270],[521,524],[521,524],[573,576],[573,576],[533,536],[533,536],[585,588],[585,588],[1246,1249],[1246,1249],[1282,1285],[1282,1285],[376,379],[376,379],[399,402],[399,402],[435,438],[435,438],[473,476],[473,476]]
|
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
root: true,
|
|
5
|
+
parserOptions: {
|
|
6
|
+
project: path.resolve(__dirname, 'tsconfig.json'),
|
|
7
|
+
tsconfigRootDir: __dirname,
|
|
8
|
+
},
|
|
9
|
+
settings: {
|
|
10
|
+
'import/resolver': {
|
|
11
|
+
typescript: {
|
|
12
|
+
project: path.resolve(__dirname, 'tsconfig.json'),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
extends: [
|
|
17
|
+
'@peak-ai/eslint-config-peak-api',
|
|
18
|
+
'@peak-ai/eslint-config-peak-base',
|
|
19
|
+
'@peak-ai/eslint-config-peak-typescript',
|
|
20
|
+
],
|
|
21
|
+
overrides: [
|
|
22
|
+
{
|
|
23
|
+
files: ['**/*.test.ts', '**/*.test.tsx'],
|
|
24
|
+
env: {
|
|
25
|
+
jest: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _regeneratorRuntime from"@babel/runtime/regenerator";/* eslint-disable @typescript-eslint/no-explicit-any */import React,{useEffect,useRef}from"react";// eslint-disable-next-line import/no-named-as-default
|
|
2
|
-
import grapesjs from"grapesjs";import"grapesjs/dist/css/grapes.min.css";import tailwind from"grapesjs-tailwind";import{TypesToRegister}from"./constants";import{toKebabCase}from"./helpers";import{createGrapesjsShadcnGenericPlugin}from"./plugins/grapejs-plugin";import{StyledEditor}from"./index.styles";import{tailwindCompiledCss}from"./helpers/css";import{datePickerCss}from"./helpers/date-picker";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function setComponentProperties(editor,isPreview){function setPropertiesRecursively(comp){comp.set({editable:!isPreview,draggable:!isPreview,droppable:!isPreview&&comp.getName()!=="Shadcn-generic",selectable:!isPreview,hoverable:!isPreview,highlightable:!isPreview,copyable:false,resizable:false,removable:!isPreview,badgable:false});if(!isPreview){comp.set("toolbar",[{attributes:{"class":"fa fa-arrows"},command:"tlb-move"},{attributes:{"class":"fa fa-trash"},command:"tlb-delete"}])}comp.components().forEach(setPropertiesRecursively)}if(isPreview){editor.runCommand("core:preview")}else{editor.stopCommand("core:preview")}var wrapper=editor.getWrapper();wrapper==null||wrapper.find("*").forEach(setPropertiesRecursively)}function convertStyles(stylesArray){return stylesArray.map(function(block){var selectors=Array.isArray(block.selectors)?block.selectors.join(", "):block.selectors;var declarations=Object.entries(block.style).map(function(_ref){var prop=_ref[0],value=_ref[1];return toKebabCase(prop)+": "+value+";"}).join(" ");return selectors+" { "+declarations+" }"}).join("\n")}function
|
|
2
|
+
import grapesjs from"grapesjs";import"grapesjs/dist/css/grapes.min.css";import tailwind from"grapesjs-tailwind";import{TypesToRegister}from"./constants";import{toKebabCase}from"./helpers";import{createGrapesjsShadcnGenericPlugin}from"./plugins/grapejs-plugin";import{StyledEditor}from"./index.styles";import{tailwindCompiledCss}from"./helpers/css";import{datePickerCss}from"./helpers/date-picker";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function setComponentProperties(editor,isPreview){function setPropertiesRecursively(comp){comp.set({editable:!isPreview,draggable:!isPreview,droppable:!isPreview&&comp.getName()!=="Shadcn-generic",selectable:!isPreview,hoverable:!isPreview,highlightable:!isPreview,copyable:false,resizable:false,removable:!isPreview,badgable:false});if(!isPreview){comp.set("toolbar",[{attributes:{"class":"fa fa-arrows"},command:"tlb-move"},{attributes:{"class":"fa fa-trash"},command:"tlb-delete"}])}comp.components().forEach(setPropertiesRecursively)}if(isPreview){editor.runCommand("core:preview")}else{editor.stopCommand("core:preview")}var wrapper=editor.getWrapper();wrapper==null||wrapper.find("*").forEach(setPropertiesRecursively)}function convertStyles(stylesArray){return stylesArray.map(function(block){var selectors=Array.isArray(block.selectors)?block.selectors.join(", "):block.selectors;var declarations=Object.entries(block.style).map(function(_ref){var prop=_ref[0],value=_ref[1];return toKebabCase(prop)+": "+value+";"}).join(" ");return selectors+" { "+declarations+" }"}).join("\n")}function createActionCardConfig(action,index){var icon=action.icon,title=action.title,description=action.description;return{type:"shadcn-generic",componentName:"ActionCard",badgable:false,copyable:false,removable:true,draggable:true,componentProps:{icon:icon,headerContent:title,bodyContent:description}}}function expandActions(node){if(node.type==="shadcn-generic"&&node.componentName==="Actions"){var _node$componentProps;var actions=(_node$componentProps=node.componentProps)==null?void 0:_node$componentProps.actions;if(Array.isArray(actions)&&actions.length>0){return _extends({},node,{type:"div",classes:["dashboard-cards"].concat(node.classes||[]),componentName:undefined,componentProps:undefined,components:actions.map(function(action,i){return _extends({},createActionCardConfig(action,i),{id:node.id+"--action-card-"+i})})})}return node}if(Array.isArray(node.components)){return _extends({},node,{components:node.components.map(expandActions)})}return node}function setInteracting(renderedComponents,components,inProgress){components.forEach(function(component){var componentId=component.componentId,showLoader=component.showLoader;if(!showLoader){return}var gjsModel=renderedComponents[componentId];if(gjsModel){gjsModel.set("attributes",_extends({},gjsModel.get("attributes"),{interactionApiInProgress:inProgress}))}})}function expandActionsComponent(model,actions){model.components("");actions.forEach(function(action){model.append(createActionCardConfig(action))});model.set("type","div");model.addClass("dashboard-cards");model.set("componentName",undefined);model.set("componentProps",{})}function GrapesjsCanvas(_ref2){var json=_ref2.json,_ref2$mode=_ref2.mode,mode=_ref2$mode===void 0?"preview":_ref2$mode,setEditor=_ref2.setEditor,performInteraction=_ref2.performInteraction,_ref2$newDataNotifier=_ref2.newDataNotifier,newDataNotifier=_ref2$newDataNotifier===void 0?function(){// no op
|
|
3
3
|
}:_ref2$newDataNotifier,setHasChanged=_ref2.setHasChanged,isStreaming=_ref2.isStreaming;var editorRef=useRef(null);var editorInstance=useRef(null);var renderedComponents=useRef({});var isStreamingRef=useRef(isStreaming);var isSystemUpdateRef=useRef(false);var lastJsonRef=useRef("");var isEditorAliveRef=useRef(false);useEffect(function(){isStreamingRef.current=isStreaming},[isStreaming]);function notificationHandler(props){if(!props){return true}var componentId=props.componentId,_props$newProps=props.newProps,newProps=_props$newProps===void 0?{}:_props$newProps,_props$newAttributes=props.newAttributes,newAttributes=_props$newAttributes===void 0?{}:_props$newAttributes;var model=renderedComponents.current[componentId];if(!model){return false}// Filter out complex placeholder objects that shouldn't be stored in the model, done intentionally to keep grapejs out of errors
|
|
4
|
-
var filteredProps=_extends({},newProps);Object.keys(filteredProps).forEach(function(key){var value=filteredProps[key];if(value&&typeof value==="object"&&value.name==="__peak_placeholder"){delete filteredProps[key]}});var parsedNewProps=_extends({},filteredProps);if(filteredProps.pagination){parsedNewProps.pagination=_extends({},model.get("componentProps").pagination||{},filteredProps.pagination)}
|
|
4
|
+
var filteredProps=_extends({},newProps);Object.keys(filteredProps).forEach(function(key){var value=filteredProps[key];if(value&&typeof value==="object"&&value.name==="__peak_placeholder"){delete filteredProps[key]}});var parsedNewProps=_extends({},filteredProps);if(filteredProps.pagination){parsedNewProps.pagination=_extends({},model.get("componentProps").pagination||{},filteredProps.pagination)}// Handle Actions component: expand into ActionCards when data arrives via streaming
|
|
5
|
+
var isActionsComponent=model.get("componentName")==="Actions";var hasValidActionsData=parsedNewProps.actions&&parsedNewProps.actions!==null&&Array.isArray(parsedNewProps.actions)&&parsedNewProps.actions.length>0;if(isActionsComponent&&hasValidActionsData){var _model$components$at;var isAlreadyExpanded=model.components().length>0&&((_model$components$at=model.components().at(0))==null?void 0:_model$components$at.get("componentName"))==="ActionCard";if(!isAlreadyExpanded){expandActionsComponent(model,parsedNewProps.actions);return true}}model.set("componentProps",_extends({},model.get("componentProps"),parsedNewProps));model.set("attributes",_extends({},model.get("attributes"),newAttributes));return true}useEffect(function(){newDataNotifier(notificationHandler)},[]);function performInteractionWrapper(_x){return _performInteractionWrapper.apply(this,arguments)}function _performInteractionWrapper(){_performInteractionWrapper=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(payload){var _editorInstance$curre;var updatedJson,apiResponse,componentUpdates;return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return(_editorInstance$curre=editorInstance.current)==null?void 0:_editorInstance$curre.store();case 2:updatedJson=_context4.sent;setInteracting(renderedComponents.current,payload.affectedComponents,true);_context4.prev=4;_context4.next=7;return performInteraction(_extends({},payload,{json:updatedJson}));case 7:apiResponse=_context4.sent;componentUpdates=apiResponse||{};Object.entries(componentUpdates).forEach(function(_ref6){var key=_ref6[0],value=_ref6[1];var model=renderedComponents.current[key];if(model){model.set("attributes",_extends({},model.get("attributes"),{error:undefined}));model.set("componentProps",_extends({},model.get("componentProps"),value,{error:undefined,isMissing:undefined}))}});return _context4.abrupt("return",componentUpdates);case 13:_context4.prev=13;_context4.t0=_context4["catch"](4);payload.affectedComponents.forEach(function(componentId){var model=renderedComponents.current[componentId];if(model){var errorMessage=_context4.t0 instanceof Error?_context4.t0.message:"Something went wrong. Please try again.";model.set("attributes",_extends({},model.get("attributes"),{error:errorMessage}));model.set("componentProps",_extends({},model.get("componentProps"),{error:errorMessage,isMissing:undefined}))}});throw _context4.t0;case 17:_context4.prev=17;setInteracting(renderedComponents.current,payload.affectedComponents,false);return _context4.finish(17);case 20:case"end":return _context4.stop()}},_callee4,null,[[4,13,17,20]])}));return _performInteractionWrapper.apply(this,arguments)}useEffect(function(){var _json$pages,_json$pages$0$frames;if(!editorRef.current){return function(){// no op
|
|
5
6
|
}}if(editorInstance.current){editorInstance.current.destroy();editorInstance.current=null;isEditorAliveRef.current=false}var currentMode=mode;var editor=grapesjs.init({container:editorRef.current,height:"100%",plugins:[tailwind,createGrapesjsShadcnGenericPlugin(currentMode,performInteractionWrapper,renderedComponents.current,setHasChanged)],storageManager:{type:"none"},richTextEditor:{actions:["bold","italic","underline","strikethrough"]},canvas:{customBadgeLabel:function customBadgeLabel(component){var tagName=component.get("tagName");return tagName==="body"?"":tagName||""}}});isEditorAliveRef.current=true;function checkDirty(){return _checkDirty.apply(this,arguments)}function _checkDirty(){_checkDirty=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(){var stored,newJson;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(isStreamingRef.current||isSystemUpdateRef.current)){_context3.next=2;break}return _context3.abrupt("return");case 2:if(!(!isEditorAliveRef.current||!editorInstance.current)){_context3.next=4;break}return _context3.abrupt("return");case 4:stored=null;_context3.prev=5;_context3.next=8;return editorInstance.current.store();case 8:stored=_context3.sent;_context3.next=14;break;case 11:_context3.prev=11;_context3.t0=_context3["catch"](5);return _context3.abrupt("return");case 14:if(stored){_context3.next=16;break}return _context3.abrupt("return");case 16:newJson=JSON.stringify(stored);if(newJson!==lastJsonRef.current){setHasChanged(true);lastJsonRef.current=newJson}case 18:case"end":return _context3.stop()}},_callee3,null,[[5,11]])}));return _checkDirty.apply(this,arguments)}var debouncedCheckDirty=function(){var timeout=null;return function(){if(timeout){clearTimeout(timeout)}timeout=setTimeout(checkDirty,200)}}();["component:add","component:remove","component:update:content","style:update","component:drag:end","rte:change"].forEach(function(evt){return editor.on(evt,debouncedCheckDirty)});editor.on("component:update",function(model,prop){if(["attributes","componentProps","content"].includes(prop)){debouncedCheckDirty()}});// Tailwind CSS rules aren't fully added to our component
|
|
6
7
|
// So, adding them from here!
|
|
7
8
|
editor.on("load",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var canvasHead,style,fullCss;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:canvasHead=editor.Canvas.getDocument().head;style=document.createElement("style");fullCss="\n "+tailwindCompiledCss+"\n "+datePickerCss+"\n ::-webkit-scrollbar {\n width: 0px;\n height: 0px;\n }\n html, body {\n overflow: auto !important;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n }\n\n ";style.innerHTML=fullCss;style.setAttribute("type","text/css");canvasHead.appendChild(style);isSystemUpdateRef.current=true;setComponentProperties(editor,mode==="preview");_context.t0=JSON;_context.next=11;return editor.store();case 11:_context.t1=_context.sent;lastJsonRef.current=_context.t0.stringify.call(_context.t0,_context.t1);isSystemUpdateRef.current=false;case 14:case"end":return _context.stop()}},_callee)})));editorInstance.current=editor;if(setEditor){setEditor(editor)}TypesToRegister.forEach(function(_ref4){var type=_ref4.type,tagName=_ref4.tagName;if(!editor.DomComponents.getType(type)){editor.DomComponents.addType(type,{model:{defaults:{tagName:tagName}},view:{}})}});if(json&&((_json$pages=json.pages)==null?void 0:_json$pages.length)>0&&((_json$pages$0$frames=json.pages[0].frames)==null?void 0:_json$pages$0$frames.length)>0){isSystemUpdateRef.current=true;var raw=json.pages[0].frames[0].component;var processed=expandActions(raw);editor.setComponents(processed);var cssText=convertStyles(json.styles||[]);editor.setStyle(cssText);editor.on("load",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.t0=JSON;_context2.next=3;return editor.store();case 3:_context2.t1=_context2.sent;lastJsonRef.current=_context2.t0.stringify.call(_context2.t0,_context2.t1);isSystemUpdateRef.current=false;case 6:case"end":return _context2.stop()}},_callee2)})))}return function cleanup(){editor.destroy();isEditorAliveRef.current=false}},[json,mode]);return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(StyledEditor,{}),/*#__PURE__*/_jsx("div",{ref:editorRef,id:"grapesjs-editor"})]})}export default GrapesjsCanvas;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrapesjsCanvas.js","names":["React","useEffect","useRef","grapesjs","tailwind","TypesToRegister","toKebabCase","createGrapesjsShadcnGenericPlugin","StyledEditor","tailwindCompiledCss","datePickerCss","jsx","_jsx","jsxs","_jsxs","setComponentProperties","editor","isPreview","setPropertiesRecursively","comp","set","editable","draggable","droppable","getName","selectable","hoverable","highlightable","copyable","resizable","removable","badgable","attributes","command","components","forEach","runCommand","stopCommand","wrapper","getWrapper","find","convertStyles","stylesArray","map","block","selectors","Array","isArray","join","declarations","Object","entries","style","_ref","prop","value","createActionCardConfig","action","index","icon","title","description","type","componentName","componentProps","headerContent","bodyContent","expandActions","node","_node$componentProps","actions","length","_extends","classes","concat","undefined","i","id","setInteracting","renderedComponents","inProgress","component","componentId","showLoader","gjsModel","get","interactionApiInProgress","expandActionsComponent","model","append","addClass","GrapesjsCanvas","_ref2","json","_ref2$mode","mode","setEditor","performInteraction","_ref2$newDataNotifier","newDataNotifier","setHasChanged","isStreaming","editorRef","editorInstance","isStreamingRef","isSystemUpdateRef","lastJsonRef","isEditorAliveRef","current","notificationHandler","props","_props$newProps","newProps","_props$newAttributes","newAttributes","filteredProps","keys","key","name","parsedNewProps","pagination","isActionsComponent","hasValidActionsData","_model$components$at","isAlreadyExpanded","at","performInteractionWrapper","_x","_performInteractionWrapper","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee4","payload","_editorInstance$curre","updatedJson","apiResponse","componentUpdates","wrap","_callee4$","_context4","prev","next","store","sent","affectedComponents","_ref6","error","isMissing","abrupt","t0","errorMessage","Error","message","finish","stop","_json$pages","_json$pages$0$frames","destroy","currentMode","init","container","height","plugins","storageManager","richTextEditor","canvas","customBadgeLabel","tagName","checkDirty","_checkDirty","_callee3","stored","newJson","_callee3$","_context3","JSON","stringify","debouncedCheckDirty","timeout","clearTimeout","setTimeout","evt","on","includes","_callee","canvasHead","fullCss","_callee$","_context","Canvas","getDocument","head","document","createElement","innerHTML","setAttribute","appendChild","t1","call","_ref4","DomComponents","getType","addType","defaults","view","pages","frames","raw","processed","setComponents","cssText","styles","setStyle","_callee2","_callee2$","_context2","cleanup","Fragment","children","ref"],"sources":["../src/GrapesjsCanvas.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useRef } from 'react';\n// eslint-disable-next-line import/no-named-as-default\nimport grapesjs, { Component, Editor } from 'grapesjs';\nimport 'grapesjs/dist/css/grapes.min.css';\nimport tailwind from 'grapesjs-tailwind';\nimport { TypesToRegister } from './constants';\nimport { toKebabCase } from './helpers';\nimport { createGrapesjsShadcnGenericPlugin } from './plugins/grapejs-plugin';\nimport { StyledEditor } from './index.styles';\nimport { tailwindCompiledCss } from './helpers/css';\nimport { datePickerCss } from './helpers/date-picker';\n\ntype NotificationHandler = (newData: {\n componentId: string;\n newProps: Record<string, any>;\n newAttributes: Record<string, any>;\n}) => boolean;\n\ntype GrapesjsCanvasProps = {\n json: any;\n mode?: 'editor' | 'preview';\n setEditor: (editor: Editor) => void;\n performInteraction: (payload: Record<string, any>) => Promise<Record<string, any> | undefined>;\n newDataNotifier: (notifHandler: NotificationHandler) => void;\n setHasChanged: (hasChanged: boolean) => void;\n isStreaming: boolean;\n};\n\nfunction setComponentProperties(editor: Editor, isPreview: boolean) {\n function setPropertiesRecursively(comp: Component) {\n comp.set({\n editable: !isPreview,\n draggable: !isPreview,\n droppable: !isPreview && comp.getName() !== 'Shadcn-generic',\n selectable: !isPreview,\n hoverable: !isPreview,\n highlightable: !isPreview,\n copyable: false,\n resizable: false,\n removable: !isPreview,\n badgable: false,\n });\n\n if (!isPreview) {\n comp.set('toolbar', [\n { attributes: { class: 'fa fa-arrows' }, command: 'tlb-move' },\n { attributes: { class: 'fa fa-trash' }, command: 'tlb-delete' },\n ]);\n }\n\n comp.components().forEach(setPropertiesRecursively);\n }\n\n if (isPreview) {\n editor.runCommand('core:preview');\n } else {\n editor.stopCommand('core:preview');\n }\n\n const wrapper = editor.getWrapper();\n wrapper?.find('*').forEach(setPropertiesRecursively);\n}\n\nfunction convertStyles(stylesArray: any[]): string {\n return stylesArray\n .map((block) => {\n const selectors = Array.isArray(block.selectors)\n ? block.selectors.join(', ')\n : block.selectors;\n const declarations = Object.entries(block.style)\n .map(([prop, value]) => `${toKebabCase(prop)}: ${value};`)\n .join(' ');\n\n return `${selectors} { ${declarations} }`;\n })\n .join('\\n');\n}\n\nfunction createActionCardConfig(action: any, index?: number): any {\n const { icon, title, description } = action;\n \n return {\n type: 'shadcn-generic',\n componentName: 'ActionCard',\n badgable: false,\n copyable: false,\n removable: true,\n draggable: true,\n componentProps: {\n icon,\n headerContent: title,\n bodyContent: description,\n },\n };\n}\n\nfunction expandActions(node: any): any {\n if (\n node.type === 'shadcn-generic' &&\n node.componentName === 'Actions'\n ) {\n const actions = node.componentProps?.actions;\n\n if (Array.isArray(actions) && actions.length > 0) {\n return {\n ...node,\n type: 'div',\n classes: ['dashboard-cards', ...(node.classes || [])],\n componentName: undefined,\n componentProps: undefined,\n components: actions.map((action: any, i: number) => ({\n ...createActionCardConfig(action, i),\n id: `${node.id}--action-card-${i}`,\n })),\n };\n }\n\n return node;\n }\n\n if (Array.isArray(node.components)) {\n return {\n ...node,\n components: node.components.map(expandActions),\n };\n }\n\n return node;\n}\n\nfunction setInteracting(\n renderedComponents: Record<string, Component>,\n components: { componentId: string; showLoader: boolean }[],\n inProgress: boolean,\n) {\n components.forEach((component) => {\n const { componentId, showLoader } = component;\n\n if (!showLoader) {\n return;\n }\n\n const gjsModel = renderedComponents[componentId];\n\n if (gjsModel) {\n gjsModel.set('attributes', {\n ...gjsModel.get('attributes'),\n interactionApiInProgress: inProgress,\n });\n }\n });\n}\n\nfunction expandActionsComponent(model: Component, actions: any[]): void {\n model.components('');\n \n actions.forEach((action: any) => {\n model.append(createActionCardConfig(action));\n });\n\n model.set('type', 'div');\n model.addClass('dashboard-cards');\n model.set('componentName', undefined);\n model.set('componentProps', {});\n}\n\nfunction GrapesjsCanvas({\n json,\n mode = 'preview',\n setEditor,\n performInteraction,\n newDataNotifier = () => {\n // no op\n },\n setHasChanged,\n isStreaming,\n}: GrapesjsCanvasProps) {\n const editorRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<Editor | null>(null);\n const renderedComponents = useRef<Record<string, Component>>({});\n const isStreamingRef = useRef(isStreaming);\n const isSystemUpdateRef = useRef(false);\n const lastJsonRef = useRef<string>('');\n const isEditorAliveRef = useRef(false);\n\n useEffect(() => {\n isStreamingRef.current = isStreaming;\n }, [isStreaming]);\n\n function notificationHandler(\n props: Parameters<NotificationHandler>[0],\n ): ReturnType<NotificationHandler> {\n if (!props) {\n return true;\n }\n\n const { componentId, newProps = {}, newAttributes = {} } = props;\n\n const model = renderedComponents.current[componentId];\n\n if (!model) {\n return false;\n }\n\n // Filter out complex placeholder objects that shouldn't be stored in the model, done intentionally to keep grapejs out of errors\n const filteredProps = { ...newProps };\n\n Object.keys(filteredProps).forEach((key) => {\n const value = filteredProps[key];\n\n if (value && typeof value === 'object' && value.name === '__peak_placeholder') {\n delete filteredProps[key];\n }\n });\n\n const parsedNewProps = {\n ...filteredProps,\n };\n\n if (filteredProps.pagination) {\n parsedNewProps.pagination = {\n ...(model.get('componentProps').pagination || {}),\n ...filteredProps.pagination,\n };\n }\n\n // Handle Actions component: expand into ActionCards when data arrives via streaming\n const isActionsComponent = model.get('componentName') === 'Actions';\n const hasValidActionsData = parsedNewProps.actions && \n parsedNewProps.actions !== null && \n Array.isArray(parsedNewProps.actions) && \n parsedNewProps.actions.length > 0;\n \n if (isActionsComponent && hasValidActionsData) {\n const isAlreadyExpanded = model.components().length > 0 && \n model.components().at(0)?.get('componentName') === 'ActionCard';\n\n if (!isAlreadyExpanded) {\n expandActionsComponent(model, parsedNewProps.actions);\n\n return true;\n }\n }\n\n model.set('componentProps', {\n ...model.get('componentProps'),\n ...parsedNewProps,\n });\n\n model.set('attributes', {\n ...model.get('attributes'),\n ...newAttributes,\n });\n\n return true;\n }\n\n useEffect(() => {\n newDataNotifier(notificationHandler);\n }, []);\n\n async function performInteractionWrapper(payload: Record<string, any>) {\n const updatedJson = await editorInstance.current?.store();\n setInteracting(renderedComponents.current, payload.affectedComponents, true);\n\n try {\n const apiResponse = await performInteraction({\n ...payload,\n json: updatedJson,\n });\n\n const componentUpdates = apiResponse || {};\n\n Object.entries(componentUpdates).forEach(([key, value]) => {\n const model = renderedComponents.current[key];\n\n if (model) {\n model.set('attributes', {\n ...model.get('attributes'),\n error: undefined,\n });\n\n model.set('componentProps', {\n ...model.get('componentProps'),\n ...value,\n error: undefined,\n isMissing: undefined,\n });\n }\n });\n\n return componentUpdates;\n } catch (error) {\n payload.affectedComponents.forEach((componentId: string) => {\n const model = renderedComponents.current[componentId];\n\n if (model) {\n const errorMessage =\n error instanceof Error ? error.message : 'Something went wrong. Please try again.';\n\n model.set('attributes', {\n ...model.get('attributes'),\n error: errorMessage,\n });\n\n model.set('componentProps', {\n ...model.get('componentProps'),\n error: errorMessage,\n isMissing: undefined,\n });\n }\n });\n\n throw error;\n } finally {\n setInteracting(renderedComponents.current, payload.affectedComponents, false);\n }\n }\n\n useEffect(() => {\n if (!editorRef.current) {\n return () => {\n // no op\n };\n }\n\n if (editorInstance.current) {\n editorInstance.current.destroy();\n editorInstance.current = null;\n isEditorAliveRef.current = false;\n }\n\n const currentMode = mode;\n\n const editor = grapesjs.init({\n container: editorRef.current,\n height: '100%',\n plugins: [\n tailwind,\n createGrapesjsShadcnGenericPlugin(\n currentMode,\n performInteractionWrapper,\n renderedComponents.current,\n setHasChanged,\n ),\n ],\n storageManager: { type: 'none' },\n richTextEditor: {\n actions: ['bold', 'italic', 'underline', 'strikethrough'],\n },\n canvas: {\n customBadgeLabel: (component) => {\n const tagName = component.get('tagName');\n\n return tagName === 'body' ? '' : tagName || '';\n },\n },\n });\n\n isEditorAliveRef.current = true;\n\n async function checkDirty() {\n if (isStreamingRef.current || isSystemUpdateRef.current) {\n return;\n }\n\n if (!isEditorAliveRef.current || !editorInstance.current) {\n return;\n }\n\n let stored = null;\n\n try {\n stored = await editorInstance.current.store();\n } catch (err) {\n return;\n }\n\n if (!stored) {\n return;\n }\n\n const newJson = JSON.stringify(stored);\n\n if (newJson !== lastJsonRef.current) {\n setHasChanged(true);\n lastJsonRef.current = newJson;\n }\n }\n\n const debouncedCheckDirty = (() => {\n let timeout: NodeJS.Timeout | null = null;\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n timeout = setTimeout(checkDirty, 200);\n };\n })();\n\n [\n 'component:add',\n 'component:remove',\n 'component:update:content',\n 'style:update',\n 'component:drag:end',\n 'rte:change',\n ].forEach((evt) => editor.on(evt, debouncedCheckDirty));\n\n editor.on('component:update', (model, prop) => {\n if (['attributes', 'componentProps', 'content'].includes(prop)) {\n debouncedCheckDirty();\n }\n });\n\n // Tailwind CSS rules aren't fully added to our component\n // So, adding them from here!\n editor.on('load', async () => {\n const canvasHead = editor.Canvas.getDocument().head;\n const style = document.createElement('style');\n const fullCss = `\n ${tailwindCompiledCss}\n ${datePickerCss}\n ::-webkit-scrollbar {\n width: 0px;\n height: 0px;\n }\n html, body {\n overflow: auto !important;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n }\n\n `;\n style.innerHTML = fullCss;\n style.setAttribute('type', 'text/css');\n canvasHead.appendChild(style);\n\n isSystemUpdateRef.current = true;\n setComponentProperties(editor, mode === 'preview');\n lastJsonRef.current = JSON.stringify(await editor.store());\n isSystemUpdateRef.current = false;\n });\n\n editorInstance.current = editor;\n\n if (setEditor) {\n setEditor(editor);\n }\n\n TypesToRegister.forEach(({ type, tagName }) => {\n if (!editor.DomComponents.getType(type)) {\n editor.DomComponents.addType(type, {\n model: {\n defaults: { tagName },\n },\n view: {},\n });\n }\n });\n\n if (json && json.pages?.length > 0 && json.pages[0].frames?.length > 0) {\n isSystemUpdateRef.current = true;\n const raw = json.pages[0].frames[0].component;\n const processed = expandActions(raw);\n editor.setComponents(processed);\n\n const cssText = convertStyles(json.styles || []);\n editor.setStyle(cssText);\n\n editor.on('load', async () => {\n lastJsonRef.current = JSON.stringify(await editor.store());\n isSystemUpdateRef.current = false;\n });\n }\n\n return function cleanup() {\n editor.destroy();\n isEditorAliveRef.current = false;\n };\n }, [json, mode]);\n\n return (\n <React.Fragment>\n <StyledEditor />\n <div ref={editorRef} id=\"grapesjs-editor\" />\n </React.Fragment>\n );\n}\n\nexport default GrapesjsCanvas;\n"],"mappings":"wLAAA,uDACA,MAAO,CAAAA,KAAK,EAAIC,SAAS,CAAEC,MAAM,KAAQ,OAAO,CAChD;AACA,MAAO,CAAAC,QAAQ,KAA6B,UAAU,CACtD,MAAO,kCAAkC,CACzC,MAAO,CAAAC,QAAQ,KAAM,mBAAmB,CACxC,OAASC,eAAe,KAAQ,aAAa,CAC7C,OAASC,WAAW,KAAQ,WAAW,CACvC,OAASC,iCAAiC,KAAQ,0BAA0B,CAC5E,OAASC,YAAY,KAAQ,gBAAgB,CAC7C,OAASC,mBAAmB,KAAQ,eAAe,CACnD,OAASC,aAAa,KAAQ,uBAAuB,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAkBtD,QAAS,CAAAC,sBAAsBA,CAACC,MAAc,CAAEC,SAAkB,CAAE,CAClE,QAAS,CAAAC,wBAAwBA,CAACC,IAAe,CAAE,CACjDA,IAAI,CAACC,GAAG,CAAC,CACPC,QAAQ,CAAE,CAACJ,SAAS,CACpBK,SAAS,CAAE,CAACL,SAAS,CACrBM,SAAS,CAAE,CAACN,SAAS,EAAIE,IAAI,CAACK,OAAO,CAAC,CAAC,GAAK,gBAAgB,CAC5DC,UAAU,CAAE,CAACR,SAAS,CACtBS,SAAS,CAAE,CAACT,SAAS,CACrBU,aAAa,CAAE,CAACV,SAAS,CACzBW,QAAQ,CAAE,KAAK,CACfC,SAAS,CAAE,KAAK,CAChBC,SAAS,CAAE,CAACb,SAAS,CACrBc,QAAQ,CAAE,KACZ,CAAC,CAAC,CAEF,G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KAAK,CAAC,CAAC,QAAAyE,SAAA,CAAAlB,EAAA,CAAAkB,SAAA,CAAAxE,IAAA,CAAzDxC,WAAW,CAACE,OAAO,CAAA8G,SAAA,CAAAlE,EAAA,CAAQ2B,SAAS,CAAAsB,IAAA,CAAAiB,SAAA,CAAAlE,EAAA,CAAAkE,SAAA,CAAAlB,EAAA,EACpC/F,iBAAiB,CAACG,OAAO,CAAG,KAAK,CAAC,wBAAA8G,SAAA,CAAA7D,IAAA,KAAA2D,QAAA,EACnC,GACH,CAEA,MAAO,SAAS,CAAAG,OAAOA,CAAA,CAAG,CACxB3M,MAAM,CAACgJ,OAAO,CAAC,CAAC,CAChBrD,gBAAgB,CAACC,OAAO,CAAG,KAC7B,CACF,CAAC,CAAE,CAACf,IAAI,CAAEE,IAAI,CAAC,CAAC,CAEhB,mBACEjF,KAAA,CAACd,KAAK,CAAC4N,QAAQ,EAAAC,QAAA,eACbjN,IAAA,CAACJ,YAAY,GAAE,CAAC,cAChBI,IAAA,QAAKkN,GAAG,CAAExH,SAAU,CAACzB,EAAE,CAAC,iBAAiB,CAAE,CAAC,EAC9B,CAEpB,CAEA,cAAe,CAAAc,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration.d.js","names":[],"sources":["../src/declaration.d.ts"],"sourcesContent":["declare module '*.gif';"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@peak-ai/canvas",
|
|
3
|
+
"author": "squad-builder-experience",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"version": "1.4.22",
|
|
6
|
+
"description": "",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@emotion/react": "^11.11.4",
|
|
9
|
+
"@emotion/styled": "^11.11.5",
|
|
10
|
+
"@mui/icons-material": "^5.15.18",
|
|
11
|
+
"@mui/material": "^5.15.18",
|
|
12
|
+
"@peak-ai/ais-components": "6.41.0",
|
|
13
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
14
|
+
"@radix-ui/react-hover-card": "^1.1.7",
|
|
15
|
+
"@radix-ui/react-label": "^2.1.3",
|
|
16
|
+
"@radix-ui/react-scroll-area": "^1.2.5",
|
|
17
|
+
"@radix-ui/react-separator": "^1.1.3",
|
|
18
|
+
"@radix-ui/react-slot": "^1.2.0",
|
|
19
|
+
"@radix-ui/react-tabs": "1.0.0",
|
|
20
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
21
|
+
"@tailwindcss/cli": "^4.1.3",
|
|
22
|
+
"@types/chroma-js": "^3.1.1",
|
|
23
|
+
"@types/react-datepicker": "^7.0.0",
|
|
24
|
+
"chroma-js": "^3.1.2",
|
|
25
|
+
"class-variance-authority": "^0.7.1",
|
|
26
|
+
"clsx": "^2.1.1",
|
|
27
|
+
"date-fns": "^4.1.0",
|
|
28
|
+
"grapesjs": "0.22.6",
|
|
29
|
+
"grapesjs-tailwind": "1.0.7",
|
|
30
|
+
"lodash": "^4.17.21",
|
|
31
|
+
"lucide-react": "^0.525.0",
|
|
32
|
+
"markdown": "^0.5.0",
|
|
33
|
+
"markdown-to-jsx": "7.4.1",
|
|
34
|
+
"plotly.js": "2.34.0",
|
|
35
|
+
"react": "^17.0.2",
|
|
36
|
+
"react-datepicker": "^8.4.0",
|
|
37
|
+
"react-dom": "^17.0.2",
|
|
38
|
+
"react-plotly.js": "^2.6.0",
|
|
39
|
+
"react-resizable-panels": "^2.1.9",
|
|
40
|
+
"styled-components": "^5.0.0",
|
|
41
|
+
"tailwind-merge": "^3.2.0",
|
|
42
|
+
"tailwindcss": "^4.1.3",
|
|
43
|
+
"tailwindcss-animate": "^1.0.7",
|
|
44
|
+
"tslib": "^2.7.0",
|
|
45
|
+
"tw-animate-css": "^1.2.5",
|
|
46
|
+
"sherlockjs": "^1.4.2",
|
|
47
|
+
"date-fns-tz": "^2.0.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": "^17.0.2",
|
|
51
|
+
"react-dom": "^17.0.2"
|
|
52
|
+
},
|
|
53
|
+
"resolutions": {
|
|
54
|
+
"@babel/traverse": "7.25.7",
|
|
55
|
+
"minimist": "1.2.6",
|
|
56
|
+
"tar": "^6.1.11"
|
|
57
|
+
},
|
|
58
|
+
"main": "index.js",
|
|
59
|
+
"types": "index.d.ts",
|
|
60
|
+
"module": "index.js",
|
|
61
|
+
"sideEffects": false
|
|
62
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";/* eslint-disable import/no-named-as-default-member *//* eslint-disable func-names *//* eslint-disable @typescript-eslint/no-explicit-any */import ReactDOM from"react-dom";import{getRenderers}from"./helpers/render-components";import{QueryCacheProvider}from"./helpers/query-cache-context";import{jsx as _jsx}from"react/jsx-runtime";export function createGrapesjsShadcnGenericPlugin(mode,performInteraction,renderedComponents,setHasChanged){if(renderedComponents===void 0){renderedComponents={}}return function grapesjsShadcnGenericPlugin(editor){editor.DomComponents.addType("shadcn-generic",{model:{defaults:{tagName:"div",droppable:false,componentName:"Card",componentProps:{},traits:[]}},view:{events:{"input [data-slot]":"handleSlotInput"},handleSlotInput:function handleSlotInput(e){var target=e.target;var slot=target.dataset.slot;var text=target.innerText;var props=this.model.get("componentProps")||{};if(!slot){return}if(slot.startsWith("table-header-")){var _props$data;var idx=parseInt(slot.split("-")[2],10);var dataKeys=Object.keys(((_props$data=props.data)==null?void 0:_props$data[0])||{});if(!props.headerMapper){props.headerMapper={}}var key=dataKeys[idx];if(key){props.headerMapper[key]=text}}else{props[slot]=text}this.model.set("componentProps",_extends({},props));if(!["search-input"].includes(slot)){setHasChanged(true)}},render:function render(){var _this=this;var compName=this.model.get("componentName");var compProps=this.model.get("componentProps");if(typeof compProps==="string"){try{compProps=JSON.parse(compProps)}catch(err){// eslint-disable-next-line no-console
|
|
2
|
+
console.error("Invalid JSON in componentProps",err);compProps={}}}compProps.isEditable=mode==="editor";compProps.performInteraction=performInteraction;compProps.onChange=function(data){_this.model.set("componentProps",_extends({},_this.model.get("componentProps"),data))};var renderers=getRenderers();var Renderer=renderers[compName];if(Renderer){if(compName==="Tabs"){ReactDOM.render(/*#__PURE__*/_jsx(QueryCacheProvider,{maxCacheSize:100,maxCacheAge:5*60*1000,children:/*#__PURE__*/_jsx(Renderer,_extends({},compProps,{gjsModel:this.model}))}),this.el);var children=this.model.components();var tabsContent=this.el.querySelectorAll(".tabs-content");var tabAttributes=this.model.get("attributes")||{};var hasTabsError=tabAttributes.error||compProps.error;var hasTabsMissing=tabAttributes.isMissing||compProps.isMissing;var isFallback=Array.from(tabsContent).some(function(el){return el.dataset.fallback==="true"});if(!isFallback&&tabsContent.length>0){// Helper function to sync child attributes
|
|
3
|
+
// eslint-disable-next-line no-inner-declarations
|
|
4
|
+
var syncChildAttributes=function syncChildAttributes(childModel){var childAttributes=childModel.get("attributes")||{};var childProps=childModel.get("componentProps")||{};var hasError=hasTabsError||childAttributes.error||childProps.error;var hasMissing=hasTabsMissing||childAttributes.isMissing||childProps.isMissing;if(hasError||hasMissing){var newAttributes=_extends({},childAttributes,{loading:false,error:hasError,isMissing:hasMissing,inheritedFromParent:!!(hasTabsError||hasTabsMissing)});childModel.set("attributes",newAttributes,{silent:false})}};children.each(function(childModel,i){var childView=_this.createView(childModel);if(childView&&tabsContent[i]){childView.render();tabsContent[i].appendChild(childView.el);setTimeout(function(){syncChildAttributes(childModel)},100);childModel.on("change:attributes",function(){syncChildAttributes(childModel)})}})}}else{ReactDOM.render(/*#__PURE__*/_jsx(QueryCacheProvider,{maxCacheSize:100,maxCacheAge:5*60*1000,children:/*#__PURE__*/_jsx(Renderer,_extends({},compProps,{gjsModel:this.model}))}),this.el)}}else{this.el.innerHTML="<div>Unsupported component: "+compName+"</div>"}renderedComponents[this.model.get("id")]=this.model;return this},createView:function createView(model){var _this$em$get$getType;var ComponentView=(_this$em$get$getType=this.em.get("DomComponents").getType(model.get("type")))==null?void 0:_this$em$get$getType.view;if(!ComponentView){// eslint-disable-next-line no-console
|
|
5
|
+
console.warn("No view found for component type:",model.get("type"));return null}var view=new ComponentView({model:model,config:this.config,componentTypes:this.componentTypes});return view},remove:function remove(){// eslint-disable-next-line import/no-named-as-default-member
|
|
6
|
+
ReactDOM.unmountComponentAtNode(this.el);return this}}})}}
|
|
7
|
+
//# sourceMappingURL=grapejs-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grapejs-plugin.js","names":["ReactDOM","getRenderers","QueryCacheProvider","jsx","_jsx","createGrapesjsShadcnGenericPlugin","mode","performInteraction","renderedComponents","setHasChanged","grapesjsShadcnGenericPlugin","editor","DomComponents","addType","model","defaults","tagName","droppable","componentName","componentProps","traits","view","events","handleSlotInput","e","target","slot","dataset","text","innerText","props","get","startsWith","_props$data","idx","parseInt","split","dataKeys","Object","keys","data","headerMapper","key","set","_extends","includes","render","_this","compName","compProps","JSON","parse","err","console","error","isEditable","onChange","renderers","Renderer","maxCacheSize","maxCacheAge","children","gjsModel","el","components","tabsContent","querySelectorAll","tabAttributes","hasTabsError","hasTabsMissing","isMissing","isFallback","Array","from","some","fallback","length","syncChildAttributes","childModel","childAttributes","childProps","hasError","hasMissing","newAttributes","loading","inheritedFromParent","silent","each","i","childView","createView","appendChild","setTimeout","on","innerHTML","_this$em$get$getType","ComponentView","em","getType","warn","config","componentTypes","remove","unmountComponentAtNode"],"sources":["../../src/plugins/grapejs-plugin.tsx"],"sourcesContent":["/* eslint-disable import/no-named-as-default-member */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport ReactDOM from 'react-dom';\nimport { Editor, Component } from 'grapesjs';\nimport { getRenderers } from './helpers/render-components';\nimport { QueryCacheProvider } from './helpers/query-cache-context';\n\nexport function createGrapesjsShadcnGenericPlugin(\n mode: 'editor' | 'preview',\n performInteraction: (payload: Record<string, any>) => void,\n renderedComponents: Record<string, Component> = {},\n setHasChanged: (hasChanged: boolean) => void,\n) {\n return function grapesjsShadcnGenericPlugin(editor: Editor): void {\n editor.DomComponents.addType('shadcn-generic', {\n model: {\n defaults: {\n tagName: 'div',\n droppable: false,\n componentName: 'Card',\n componentProps: {},\n traits: [],\n },\n },\n view: {\n events: {\n 'input [data-slot]': 'handleSlotInput',\n } as any,\n handleSlotInput(e: Event) {\n const target = e.target as HTMLElement;\n const slot = target.dataset.slot;\n const text = target.innerText;\n\n const props = this.model.get('componentProps') || {};\n\n if (!slot) {\n return;\n }\n\n if (slot.startsWith('table-header-')) {\n const idx = parseInt(slot.split('-')[2], 10);\n const dataKeys = Object.keys(props.data?.[0] || {});\n\n if (!props.headerMapper) {\n props.headerMapper = {};\n }\n\n const key = dataKeys[idx];\n\n if (key) {\n props.headerMapper[key] = text;\n }\n } else {\n props[slot] = text;\n }\n\n this.model.set('componentProps', {\n ...props,\n });\n\n if (!['search-input'].includes(slot)) {\n setHasChanged(true);\n }\n },\n render: function () {\n const compName: string = this.model.get('componentName');\n let compProps: any = this.model.get('componentProps');\n\n if (typeof compProps === 'string') {\n try {\n compProps = JSON.parse(compProps);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Invalid JSON in componentProps', err);\n compProps = {};\n }\n }\n\n compProps.isEditable = mode === 'editor';\n compProps.performInteraction = performInteraction;\n\n compProps.onChange = (data: Record<string, any>) => {\n this.model.set('componentProps', {\n ...this.model.get('componentProps'),\n ...data,\n });\n };\n\n const renderers = getRenderers();\n const Renderer = renderers[compName];\n\n if (Renderer) {\n if (compName === 'Tabs') {\n ReactDOM.render(\n <QueryCacheProvider maxCacheSize={100} maxCacheAge={5 * 60 * 1000}>\n <Renderer {...compProps} gjsModel={this.model} />\n </QueryCacheProvider>,\n this.el\n );\n\n const children = this.model.components();\n const tabsContent = this.el.querySelectorAll('.tabs-content');\n\n const tabAttributes = this.model.get('attributes') || {};\n const hasTabsError = tabAttributes.error || compProps.error;\n const hasTabsMissing = tabAttributes.isMissing || compProps.isMissing;\n const isFallback = Array.from(tabsContent).some(\n (el: Element) => (el as HTMLElement).dataset.fallback === 'true',\n );\n\n if (!isFallback && tabsContent.length > 0) {\n // Helper function to sync child attributes\n // eslint-disable-next-line no-inner-declarations\n function syncChildAttributes(childModel: any) {\n const childAttributes = childModel.get('attributes') || {};\n const childProps = childModel.get('componentProps') || {};\n\n const hasError = hasTabsError || childAttributes.error || childProps.error;\n const hasMissing =\n hasTabsMissing || childAttributes.isMissing || childProps.isMissing;\n\n if (hasError || hasMissing) {\n const newAttributes = {\n ...childAttributes,\n loading: false,\n error: hasError,\n isMissing: hasMissing,\n inheritedFromParent: !!(hasTabsError || hasTabsMissing),\n };\n\n childModel.set('attributes', newAttributes, { silent: false });\n }\n }\n\n children.each((childModel, i) => {\n const childView = this.createView(childModel);\n\n if (childView && tabsContent[i]) {\n childView.render();\n tabsContent[i].appendChild(childView.el);\n\n setTimeout(() => {\n syncChildAttributes(childModel);\n }, 100);\n\n childModel.on('change:attributes', () => {\n syncChildAttributes(childModel);\n });\n }\n });\n }\n } else {\n ReactDOM.render(\n <QueryCacheProvider maxCacheSize={100} maxCacheAge={5 * 60 * 1000}>\n <Renderer {...compProps} gjsModel={this.model} />\n </QueryCacheProvider>,\n this.el\n );\n }\n } else {\n this.el.innerHTML = `<div>Unsupported component: ${compName}</div>`;\n }\n\n renderedComponents[this.model.get('id')] = this.model;\n\n return this;\n },\n createView(model: any) {\n const ComponentView = this.em.get('DomComponents').getType(model.get('type'))?.view;\n\n if (!ComponentView) {\n // eslint-disable-next-line no-console\n console.warn('No view found for component type:', model.get('type'));\n\n return null;\n }\n\n const view = new ComponentView({\n model,\n config: this.config,\n componentTypes: this.componentTypes,\n });\n\n return view;\n },\n remove: function () {\n // eslint-disable-next-line import/no-named-as-default-member\n ReactDOM.unmountComponentAtNode(this.el);\n\n return this;\n },\n },\n });\n };\n}\n"],"mappings":"qDAAA,sDACA,+BACA,uDACA,MAAO,CAAAA,QAAQ,KAAM,WAAW,CAEhC,OAASC,YAAY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O,CAAAhF,IACT,CAAC,CACDiF,MAAM,CAAE,QAAR,CAAAA,MAAMA,CAAA,CAAc,CAClB;AACAtG,QAAQ,CAACuG,sBAAsB,CAAC,IAAI,CAACxC,EAAE,CAAC,CAExC,MAAO,KACT,CACF,CACF,CAAC,CACH,CACF","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React,{useEffect}from"react";import{X}from"lucide-react";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function CustomModal(_ref){var isOpen=_ref.isOpen,onClose=_ref.onClose,title=_ref.title,children=_ref.children,_ref$className=_ref.className,className=_ref$className===void 0?"":_ref$className,titleIcon=_ref.titleIcon;useEffect(function(){function handleEscapeKey(event){if(event.key==="Escape"&&isOpen){onClose()}}if(isOpen){var _iframe$contentWindow;document.addEventListener("keydown",handleEscapeKey);var iframe=document.querySelector(".gjs-frame");var iframeDocument=(iframe==null?void 0:iframe.contentDocument)||(iframe==null||(_iframe$contentWindow=iframe.contentWindow)==null?void 0:_iframe$contentWindow.document);if(iframeDocument){var _iframeDocument$docum;(_iframeDocument$docum=iframeDocument.documentElement)==null||_iframeDocument$docum.style.setProperty("overflow","hidden","important")}return function(){document.removeEventListener("keydown",handleEscapeKey);if(iframeDocument){var _iframeDocument$docum2;(_iframeDocument$docum2=iframeDocument.documentElement)==null||_iframeDocument$docum2.style.removeProperty("overflow")}}}return function(){document.removeEventListener("keydown",handleEscapeKey)}},[isOpen,onClose]);function handleBackdropClick(event){if(event.target===event.currentTarget){onClose()}}if(!isOpen){return null}return/*#__PURE__*/_jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black bg-opacity-30 "+className,onClick:handleBackdropClick,children:[/*#__PURE__*/_jsxs("div",{className:"relative w-full max-w-2xl max-h-[90vh] min-h-[45vh] bg-white rounded-lg shadow-xl overflow-hidden animate-modal-fade-in",onClick:function onClick(e){return e.stopPropagation()},children:[/*#__PURE__*/_jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50 relative flex items-center justify-between",children:[/*#__PURE__*/_jsxs("h2",{className:"flex items-center text-lg font-semibold text-gray-900",children:[titleIcon&&/*#__PURE__*/_jsx("span",{className:"mr-2",children:titleIcon}),title]}),/*#__PURE__*/_jsx("button",{onClick:onClose,className:"transition-colors duration-200 hover:bg-gray-100 rounded p-1 flex items-center justify-center",type:"button","aria-label":"Close modal",style:{width:"24px",height:"24px"},children:/*#__PURE__*/_jsx(X,{size:12,className:"text-gray-600",style:{opacity:1,transform:"rotate(0deg)"}})})]}),/*#__PURE__*/_jsx("div",{className:"overflow-y-auto max-h-[calc(90vh-160px)]",children:children})]}),/*#__PURE__*/_jsx("style",{children:"\n .animate-modal-fade-in {\n animation: modalFadeIn 0.2s ease-out;\n }\n \n @keyframes modalFadeIn {\n from {\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n }\n "})]})}export default CustomModal;
|
|
2
|
+
//# sourceMappingURL=custom-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-modal.js","names":["React","useEffect","X","jsx","_jsx","jsxs","_jsxs","CustomModal","_ref","isOpen","onClose","title","children","_ref$className","className","titleIcon","handleEscapeKey","event","key","_iframe$contentWindow","document","addEventListener","iframe","querySelector","iframeDocument","contentDocument","contentWindow","_iframeDocument$docum","documentElement","style","setProperty","removeEventListener","_iframeDocument$docum2","removeProperty","handleBackdropClick","target","currentTarget","onClick","e","stopPropagation","type","width","height","size","opacity","transform"],"sources":["../../../src/plugins/helpers/custom-modal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { X } from 'lucide-react';\n\ntype CustomModalProps = {\n isOpen: boolean;\n onClose: () => void;\n title: string;\n children: React.ReactNode;\n className?: string;\n titleIcon?: React.ReactNode;\n}\n\nexport function CustomModal({\n isOpen,\n onClose,\n title,\n children,\n className = '',\n titleIcon\n}: CustomModalProps) {\n\n useEffect(() => {\n function handleEscapeKey(event: KeyboardEvent) {\n if (event.key === 'Escape' && isOpen) {\n onClose();\n }\n }\n\n if (isOpen) {\n document.addEventListener('keydown', handleEscapeKey);\n const iframe = document.querySelector('.gjs-frame') as HTMLIFrameElement;\n const iframeDocument = iframe?.contentDocument || iframe?.contentWindow?.document;\n \n if (iframeDocument) {\n iframeDocument.documentElement?.style.setProperty('overflow', 'hidden', 'important');\n }\n\n return () => {\n document.removeEventListener('keydown', handleEscapeKey);\n \n if (iframeDocument) {\n iframeDocument.documentElement?.style.removeProperty('overflow');\n }\n };\n }\n\n return () => {\n document.removeEventListener('keydown', handleEscapeKey);\n };\n }, [isOpen, onClose]);\n\n function handleBackdropClick(event: React.MouseEvent<HTMLDivElement>) {\n if (event.target === event.currentTarget) {\n onClose();\n }\n }\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <div\n className={`fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black bg-opacity-30 ${className}`}\n onClick={handleBackdropClick}\n >\n <div\n className=\"relative w-full max-w-2xl max-h-[90vh] min-h-[45vh] bg-white rounded-lg shadow-xl overflow-hidden animate-modal-fade-in\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"p-6 border-b border-gray-200 bg-gray-50 relative flex items-center justify-between\">\n <h2 className=\"flex items-center text-lg font-semibold text-gray-900\">\n {titleIcon && <span className=\"mr-2\">{titleIcon}</span>}\n {title}\n </h2>\n\n <button\n onClick={onClose}\n className=\"transition-colors duration-200 hover:bg-gray-100 rounded p-1 flex items-center justify-center\"\n type=\"button\"\n aria-label=\"Close modal\"\n style={{\n width: '24px',\n height: '24px'\n }}\n >\n <X \n size={12}\n className=\"text-gray-600\"\n style={{ \n opacity: 1,\n transform: 'rotate(0deg)'\n }}\n />\n </button>\n </div>\n\n <div className=\"overflow-y-auto max-h-[calc(90vh-160px)]\">\n {children}\n </div>\n </div>\n\n <style>{`\n .animate-modal-fade-in {\n animation: modalFadeIn 0.2s ease-out;\n }\n \n @keyframes modalFadeIn {\n from {\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n }\n `}</style>\n </div>\n );\n}\n\nexport default CustomModal;\n"],"mappings":"AAAA,MAAO,CAAAA,KAAK,EAAIC,SAAS,KAAQ,OAAO,CACxC,OAASC,CAAC,KAAQ,cAAc,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAWjC,MAAO,SAAS,CAAAC,WAAWA,CAAAC,IAAA,CAON,IANnB,CAAAC,MAAM,CAAAD,IAAA,CAANC,MAAM,CACNC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CACPC,KAAK,CAAAH,IAAA,CAALG,KAAK,CACLC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CAAAC,cAAA,CAAAL,IAAA,CACRM,SAAS,CAATA,SAAS,CAAAD,cAAA,UAAG,EAAE,CAAAA,cAAA,CACdE,SAAS,CAAAP,IAAA,CAATO,SAAS,CAGTd,SAAS,CAAC,UAAM,CACd,QAAS,CAAAe,eAAeA,CAACC,KAAoB,CAAE,CAC7C,GAAIA,KAAK,CAACC,GAAG,GAAK,QAAQ,EAAIT,MAAM,CAAE,CACpCC,OAAO,CAAC,CACV,CACF,CAEA,GAAID,MAAM,CAAE,KAAAU,qBAAA,CACVC,QAAQ,CAACC,gBAAgB,CAAC,SAAS,CAAEL,eAAe,CAAC,CACrD,GAAM,CAAAM,MAAM,CAAGF,QAAQ,CAACG,aAAa,CAAC,YAAY,CAAsB,CACxE,GAAM,CAAAC,cAAc,CAAG,CAAAF,MAAM,cAANA,MAAM,CAAEG,eAAe,IAAIH,MAAM,SAAAH,qBAAA,CAANG,MAAM,CAAEI,aAAa,eAArBP,qBAAA,CAAuBC,QAAQ,EAEjF,GAAII,cAAc,CAAE,KAAAG,qBAAA,CAClB,CAAAA,qBAAA,CAAAH,cAAc,CAACI,eAAe,SAA9BD,qBAAA,CAAgCE,KAAK,CAACC,WAA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AAE,MAAM,CACbC,MAAM,CAAE,MACV,CAAE,CAAA9B,QAAA,cAEFR,IAAA,CAACF,CAAC,EACAyC,IAAI,CAAE,EAAG,CACT7B,SAAS,CAAC,eAAe,CACzBe,KAAK,CAAE,CACLe,OAAO,CAAE,CAAC,CACVC,SAAS,CAAE,cACb,CAAE,CACH,CAAC,CACI,CAAC,EACN,CAAC,cAENzC,IAAA,QAAKU,SAAS,CAAC,0CAA0C,CAAAF,QAAA,CACtDA,QAAQ,CACN,CAAC,EACH,CAAC,cAENR,IAAA,UAAAQ,QAAA,sXAeS,CAAC,EACP,CAET,CAEA,cAAe,CAAAL,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryCacheEntry, InteractionType, InteractionState } from './query-cache-utils';
|
|
3
|
+
type QueryCacheContextValue = {
|
|
4
|
+
getCachedQuery: (componentId: string, interactionType: InteractionType, state: InteractionState) => QueryCacheEntry | null;
|
|
5
|
+
setCachedQuery: (componentId: string, interactionType: InteractionType, state: InteractionState, entry: QueryCacheEntry) => void;
|
|
6
|
+
invalidateComponent: (componentId: string) => void;
|
|
7
|
+
invalidateAll: () => void;
|
|
8
|
+
isCached: (componentId: string, interactionType: InteractionType, state: InteractionState) => boolean;
|
|
9
|
+
};
|
|
10
|
+
type QueryCacheProviderProps = {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
maxCacheSize?: number;
|
|
13
|
+
maxCacheAge?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function QueryCacheProvider({ children, maxCacheSize, maxCacheAge, }: QueryCacheProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function useQueryCache(): QueryCacheContextValue;
|
|
17
|
+
export declare function useInvalidateCacheOnChange(componentId: string | undefined, dependencies: unknown[]): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React,{createContext,useContext,useCallback,useRef,useMemo}from"react";import{getGlobalQueryCache,configureGlobalQueryCache}from"./query-cache-singleton";import{jsx as _jsx}from"react/jsx-runtime";var QueryCacheContext=/*#__PURE__*/createContext(null);export function QueryCacheProvider(_ref){var children=_ref.children,_ref$maxCacheSize=_ref.maxCacheSize,maxCacheSize=_ref$maxCacheSize===void 0?100:_ref$maxCacheSize,_ref$maxCacheAge=_ref.maxCacheAge,maxCacheAge=_ref$maxCacheAge===void 0?5*60*1000:_ref$maxCacheAge;var isConfigured=useRef(false);if(!isConfigured.current){configureGlobalQueryCache(maxCacheSize,maxCacheAge);isConfigured.current=true}var cacheManager=useRef(getGlobalQueryCache()).current;var getCachedQuery=useCallback(function(componentId,interactionType,state){return cacheManager.getCachedQuery(componentId,interactionType,state)},[cacheManager]);var setCachedQuery=useCallback(function(componentId,interactionType,state,entry){cacheManager.setCachedQuery(componentId,interactionType,state,entry)},[cacheManager]);var invalidateComponent=useCallback(function(componentId){cacheManager.invalidateComponent(componentId)},[cacheManager]);var invalidateAll=useCallback(function(){cacheManager.invalidateAll()},[cacheManager]);var isCached=useCallback(function(componentId,interactionType,state){return cacheManager.isCached(componentId,interactionType,state)},[cacheManager]);var value=useMemo(function(){return{getCachedQuery:getCachedQuery,setCachedQuery:setCachedQuery,invalidateComponent:invalidateComponent,invalidateAll:invalidateAll,isCached:isCached}},[getCachedQuery,setCachedQuery,invalidateComponent,invalidateAll,isCached]);return/*#__PURE__*/_jsx(QueryCacheContext.Provider,{value:value,children:children})}export function useQueryCache(){var context=useContext(QueryCacheContext);if(!context){throw new Error("useQueryCache must be used within a QueryCacheProvider")}return context}export function useInvalidateCacheOnChange(componentId,dependencies){var _useQueryCache=useQueryCache(),invalidateComponent=_useQueryCache.invalidateComponent;var prevDepsRef=useRef([]);React.useEffect(function(){if(prevDepsRef.current.length===0){prevDepsRef.current=dependencies;return}var hasChanged=dependencies.some(function(dep,index){return dep!==prevDepsRef.current[index]});if(hasChanged&&componentId){invalidateComponent(componentId)}prevDepsRef.current=dependencies},[componentId,invalidateComponent,dependencies])}
|
|
2
|
+
//# sourceMappingURL=query-cache-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-cache-context.js","names":["React","createContext","useContext","useCallback","useRef","useMemo","getGlobalQueryCache","configureGlobalQueryCache","jsx","_jsx","QueryCacheContext","QueryCacheProvider","_ref","children","_ref$maxCacheSize","maxCacheSize","_ref$maxCacheAge","maxCacheAge","isConfigured","current","cacheManager","getCachedQuery","componentId","interactionType","state","setCachedQuery","entry","invalidateComponent","invalidateAll","isCached","value","Provider","useQueryCache","context","Error","useInvalidateCacheOnChange","dependencies","_useQueryCache","prevDepsRef","useEffect","length","hasChanged","some","dep","index"],"sources":["../../../src/plugins/helpers/query-cache-context.tsx"],"sourcesContent":["import React, { createContext, useContext, useCallback, useRef, useMemo } from 'react';\nimport {\n QueryCacheEntry,\n InteractionType,\n InteractionState,\n} from './query-cache-utils';\nimport { getGlobalQueryCache, configureGlobalQueryCache } from './query-cache-singleton';\n\ntype QueryCacheContextValue = {\n getCachedQuery: (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState\n ) => QueryCacheEntry | null;\n \n setCachedQuery: (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState,\n entry: QueryCacheEntry\n ) => void;\n \n invalidateComponent: (componentId: string) => void;\n\n invalidateAll: () => void;\n\n isCached: (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState\n ) => boolean;\n};\n\nconst QueryCacheContext = createContext<QueryCacheContextValue | null>(null);\n\ntype QueryCacheProviderProps = {\n children: React.ReactNode;\n maxCacheSize?: number;\n maxCacheAge?: number;\n};\n\nexport function QueryCacheProvider({\n children,\n maxCacheSize = 100,\n maxCacheAge = 5 * 60 * 1000, // 5 minutes\n}: QueryCacheProviderProps) {\n const isConfigured = useRef(false);\n \n if (!isConfigured.current) {\n configureGlobalQueryCache(maxCacheSize, maxCacheAge);\n isConfigured.current = true;\n }\n\n const cacheManager = useRef(getGlobalQueryCache()).current;\n \n const getCachedQuery = useCallback(\n (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState\n ): QueryCacheEntry | null => {\n return cacheManager.getCachedQuery(componentId, interactionType, state);\n },\n [cacheManager]\n );\n \n const setCachedQuery = useCallback(\n (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState,\n entry: QueryCacheEntry\n ) => {\n cacheManager.setCachedQuery(componentId, interactionType, state, entry);\n },\n [cacheManager]\n );\n \n const invalidateComponent = useCallback(\n (componentId: string) => {\n cacheManager.invalidateComponent(componentId);\n },\n [cacheManager]\n );\n \n const invalidateAll = useCallback(() => {\n cacheManager.invalidateAll();\n }, [cacheManager]);\n \n const isCached = useCallback(\n (\n componentId: string,\n interactionType: InteractionType,\n state: InteractionState\n ): boolean => {\n return cacheManager.isCached(componentId, interactionType, state);\n },\n [cacheManager]\n );\n \n const value = useMemo(\n () => ({\n getCachedQuery,\n setCachedQuery,\n invalidateComponent,\n invalidateAll,\n isCached,\n }),\n [getCachedQuery, setCachedQuery, invalidateComponent, invalidateAll, isCached]\n );\n \n return (\n <QueryCacheContext.Provider value={value}>\n {children}\n </QueryCacheContext.Provider>\n );\n}\n\nexport function useQueryCache(): QueryCacheContextValue {\n const context = useContext(QueryCacheContext);\n \n if (!context) {\n throw new Error('useQueryCache must be used within a QueryCacheProvider');\n }\n \n return context;\n}\n\nexport function useInvalidateCacheOnChange(\n componentId: string | undefined,\n dependencies: unknown[]\n): void {\n const { invalidateComponent } = useQueryCache();\n const prevDepsRef = useRef<unknown[]>([]);\n \n React.useEffect(() => {\n if (prevDepsRef.current.length === 0) {\n prevDepsRef.current = dependencies;\n\n return;\n }\n \n const hasChanged = dependencies.some(\n (dep, index) => dep !== prevDepsRef.current[index]\n );\n \n if (hasChanged && componentId) {\n invalidateComponent(componentId);\n }\n \n prevDepsRef.current = dependencies;\n }, [componentId, invalidateComponent, dependencies]);\n}\n\n"],"mappings":"AAAA,MAAO,CAAAA,KAAK,EAAIC,aAAa,CAAEC,UAAU,CAAE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