@studiocms/wysiwyg 0.1.0-experimental.5 → 0.1.1

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.
Files changed (164) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -28
  3. package/dist/common/gjs-blocks.d.ts +4 -0
  4. package/dist/common/gjs-blocks.js +27 -0
  5. package/dist/common/gjs-componentRegistry.d.ts +31 -0
  6. package/dist/common/gjs-componentRegistry.js +59 -0
  7. package/dist/common/gjs-editor-settings.d.ts +23 -0
  8. package/dist/common/gjs-editor-settings.js +357 -0
  9. package/dist/common/gjs-editor-utils.d.ts +165 -0
  10. package/dist/common/gjs-editor-utils.js +217 -0
  11. package/dist/common/grapesBlocks/blocks/basics.d.ts +4 -0
  12. package/dist/common/grapesBlocks/blocks/basics.js +279 -0
  13. package/dist/common/grapesBlocks/blocks/extras.d.ts +4 -0
  14. package/dist/common/grapesBlocks/blocks/extras.js +63 -0
  15. package/dist/common/grapesBlocks/blocks/forms.d.ts +4 -0
  16. package/dist/{wysiwyg/editorPlugins/forms/blocks.js → common/grapesBlocks/blocks/forms.js} +15 -14
  17. package/dist/common/grapesBlocks/blocks/index.d.ts +5 -0
  18. package/dist/common/grapesBlocks/blocks/index.js +23 -0
  19. package/dist/common/grapesBlocks/blocks/tabs.d.ts +4 -0
  20. package/dist/{wysiwyg/editorPlugins/tabs/blocks.js → common/grapesBlocks/blocks/tabs.js} +9 -8
  21. package/dist/common/grapesBlocks/commands/clear.d.ts +4 -0
  22. package/dist/common/grapesBlocks/commands/clear.js +21 -0
  23. package/dist/common/grapesBlocks/commands/customCodeCommands.d.ts +4 -0
  24. package/dist/{wysiwyg/editorPlugins/code/commands.js → common/grapesBlocks/commands/customCodeCommands.js} +11 -9
  25. package/dist/common/grapesBlocks/commands/deviceCommands.js +23 -0
  26. package/dist/common/grapesBlocks/commands/index.d.ts +5 -0
  27. package/dist/common/grapesBlocks/commands/index.js +40 -0
  28. package/dist/common/grapesBlocks/commands/openImport.d.ts +4 -0
  29. package/dist/common/grapesBlocks/commands/openImport.js +71 -0
  30. package/dist/common/grapesBlocks/components/countdown.d.ts +12 -0
  31. package/dist/common/grapesBlocks/components/countdown.js +147 -0
  32. package/dist/common/grapesBlocks/components/customCode.d.ts +4 -0
  33. package/dist/{wysiwyg/editorPlugins/code/components.js → common/grapesBlocks/components/customCode.js} +16 -15
  34. package/dist/common/grapesBlocks/components/forms.d.ts +3 -0
  35. package/dist/{wysiwyg/editorPlugins/forms/components.js → common/grapesBlocks/components/forms.js} +30 -36
  36. package/dist/common/grapesBlocks/components/index.d.ts +5 -0
  37. package/dist/common/grapesBlocks/components/index.js +23 -0
  38. package/dist/common/grapesBlocks/components/tabLoader.d.ts +4 -0
  39. package/dist/{wysiwyg/editorPlugins/tabs/components/index.js → common/grapesBlocks/components/tabLoader.js} +7 -7
  40. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tab.d.ts +1 -1
  41. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tab.js +2 -2
  42. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContainer.d.ts +1 -1
  43. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContent.d.ts +1 -1
  44. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContents.d.ts +1 -1
  45. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tabs.d.ts +1 -1
  46. package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tabs.js +8 -8
  47. package/dist/common/grapesBlocks/components/tooltip.d.ts +4 -0
  48. package/dist/{wysiwyg/editorPlugins → common/grapesBlocks/components}/tooltip.js +15 -87
  49. package/dist/common/grapesBlocks/components/typed.d.ts +9 -0
  50. package/dist/{wysiwyg/editorPlugins/typed/components.js → common/grapesBlocks/components/typed.js} +7 -7
  51. package/dist/common/grapesBlocks/consts.d.ts +25 -0
  52. package/dist/common/grapesBlocks/consts.js +245 -0
  53. package/dist/common/grapesBlocks/i18n/index.d.ts +3 -0
  54. package/dist/common/grapesBlocks/i18n/index.js +19 -0
  55. package/dist/common/grapesBlocks/panels/index.d.ts +4 -0
  56. package/dist/common/grapesBlocks/panels/index.js +171 -0
  57. package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/colorPicker.d.ts +9 -0
  58. package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/colorPicker.js +16 -2
  59. package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/index.d.ts +3 -3
  60. package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/index.js +18 -12
  61. package/dist/common/grapesBlocks/selectors/index.d.ts +4 -0
  62. package/dist/common/grapesBlocks/selectors/index.js +9 -0
  63. package/dist/common/grapesBlocks/selectors/tooltip.d.ts +4 -0
  64. package/dist/common/grapesBlocks/selectors/tooltip.js +15 -0
  65. package/dist/common/grapesBlocks/traits/formTraits.d.ts +3 -0
  66. package/dist/{wysiwyg/editorPlugins/forms/traits.js → common/grapesBlocks/traits/formTraits.js} +12 -8
  67. package/dist/common/grapesBlocks/traits/index.d.ts +4 -0
  68. package/dist/common/grapesBlocks/traits/index.js +15 -0
  69. package/dist/common/grapesBlocks/traits/typedTraits.d.ts +3 -0
  70. package/dist/common/grapesBlocks/traits/typedTraits.js +24 -0
  71. package/dist/{wysiwyg/editorPlugins/tuiImageEditor.d.ts → common/grapesBlocks/tuiImageEditor/index.d.ts} +2 -2
  72. package/dist/{wysiwyg/editorPlugins/tuiImageEditor.js → common/grapesBlocks/tuiImageEditor/index.js} +6 -7
  73. package/dist/common/grapesBlocks/types.d.ts +446 -0
  74. package/dist/components/Editor.astro +153 -0
  75. package/dist/components/render.d.ts +15 -0
  76. package/dist/components/render.js +11 -0
  77. package/dist/consts.d.ts +31 -0
  78. package/dist/consts.js +15 -0
  79. package/dist/index.d.ts +39 -0
  80. package/dist/index.js +71 -0
  81. package/dist/lib/db.d.ts +83 -0
  82. package/dist/lib/db.js +50 -0
  83. package/dist/lib/prerender.d.ts +10 -0
  84. package/dist/lib/prerender.js +22 -0
  85. package/dist/{wysiwyg → lib}/shared.d.ts +3 -6
  86. package/dist/lib/shared.js +6 -0
  87. package/dist/{utils.d.ts → lib/utils.d.ts} +1 -1
  88. package/dist/lib/utils.js +10 -0
  89. package/dist/routes/grapes.css.d.ts +7 -0
  90. package/dist/routes/grapes.css.js +13 -0
  91. package/dist/routes/partial.astro +44 -0
  92. package/dist/routes/store.d.ts +1 -0
  93. package/dist/routes/store.js +121 -0
  94. package/dist/schema.d.ts +60 -0
  95. package/dist/schema.js +24 -0
  96. package/dist/styles/editor.css +150 -0
  97. package/dist/styles/grapes.css +71 -0
  98. package/dist/types.d.ts +66 -0
  99. package/dist/types.js +9 -0
  100. package/package.json +30 -28
  101. package/dist/common/prepareRender.d.ts +0 -11
  102. package/dist/common/prepareRender.js +0 -24
  103. package/dist/studio/components/Render.astro +0 -11
  104. package/dist/studio/components/StudioSDKEditor.astro +0 -334
  105. package/dist/studio/index.d.ts +0 -38
  106. package/dist/studio/index.js +0 -58
  107. package/dist/studio/routes/partial.astro +0 -27
  108. package/dist/studio/shared.d.ts +0 -17
  109. package/dist/studio/shared.js +0 -7
  110. package/dist/studio/utils.d.ts +0 -105
  111. package/dist/studio/utils.js +0 -244
  112. package/dist/studio/virtual.d.ts +0 -114
  113. package/dist/utils.js +0 -15
  114. package/dist/wysiwyg/components/Editor.astro +0 -765
  115. package/dist/wysiwyg/components/Render.astro +0 -11
  116. package/dist/wysiwyg/editorPlugins/blocks/blocks.d.ts +0 -3
  117. package/dist/wysiwyg/editorPlugins/blocks/blocks.js +0 -239
  118. package/dist/wysiwyg/editorPlugins/blocks/index.d.ts +0 -80
  119. package/dist/wysiwyg/editorPlugins/blocks/index.js +0 -26
  120. package/dist/wysiwyg/editorPlugins/code/blocks.d.ts +0 -4
  121. package/dist/wysiwyg/editorPlugins/code/blocks.js +0 -20
  122. package/dist/wysiwyg/editorPlugins/code/commands.d.ts +0 -4
  123. package/dist/wysiwyg/editorPlugins/code/components.d.ts +0 -4
  124. package/dist/wysiwyg/editorPlugins/code/index.d.ts +0 -47
  125. package/dist/wysiwyg/editorPlugins/code/index.js +0 -28
  126. package/dist/wysiwyg/editorPlugins/code/utils.d.ts +0 -3
  127. package/dist/wysiwyg/editorPlugins/code/utils.js +0 -8
  128. package/dist/wysiwyg/editorPlugins/countdown.d.ts +0 -86
  129. package/dist/wysiwyg/editorPlugins/countdown.js +0 -163
  130. package/dist/wysiwyg/editorPlugins/forms/blocks.d.ts +0 -3
  131. package/dist/wysiwyg/editorPlugins/forms/components.d.ts +0 -11
  132. package/dist/wysiwyg/editorPlugins/forms/index.d.ts +0 -21
  133. package/dist/wysiwyg/editorPlugins/forms/index.js +0 -18
  134. package/dist/wysiwyg/editorPlugins/forms/traits.d.ts +0 -2
  135. package/dist/wysiwyg/editorPlugins/index.d.ts +0 -9
  136. package/dist/wysiwyg/editorPlugins/index.js +0 -20
  137. package/dist/wysiwyg/editorPlugins/rte/styles.css +0 -63
  138. package/dist/wysiwyg/editorPlugins/tabs/blocks.d.ts +0 -3
  139. package/dist/wysiwyg/editorPlugins/tabs/components/index.d.ts +0 -4
  140. package/dist/wysiwyg/editorPlugins/tabs/index.d.ts +0 -5
  141. package/dist/wysiwyg/editorPlugins/tabs/index.js +0 -15
  142. package/dist/wysiwyg/editorPlugins/tabs/options.d.ts +0 -5
  143. package/dist/wysiwyg/editorPlugins/tabs/options.js +0 -80
  144. package/dist/wysiwyg/editorPlugins/tabs/types.d.ts +0 -81
  145. package/dist/wysiwyg/editorPlugins/tooltip.d.ts +0 -68
  146. package/dist/wysiwyg/editorPlugins/typed/blocks.d.ts +0 -4
  147. package/dist/wysiwyg/editorPlugins/typed/blocks.js +0 -15
  148. package/dist/wysiwyg/editorPlugins/typed/components.d.ts +0 -9
  149. package/dist/wysiwyg/editorPlugins/typed/index.d.ts +0 -35
  150. package/dist/wysiwyg/editorPlugins/typed/index.js +0 -18
  151. package/dist/wysiwyg/editorPlugins/typed/traits.js +0 -18
  152. package/dist/wysiwyg/editorPlugins/typed/utils.d.ts +0 -2
  153. package/dist/wysiwyg/editorPlugins/typed/utils.js +0 -6
  154. package/dist/wysiwyg/index.d.ts +0 -20
  155. package/dist/wysiwyg/index.js +0 -47
  156. package/dist/wysiwyg/routes/partial.astro +0 -27
  157. package/dist/wysiwyg/shared.js +0 -7
  158. package/dist/wysiwyg/styles/main.css +0 -52
  159. package/dist/wysiwyg/virtual.d.ts +0 -3
  160. /package/dist/{wysiwyg/editorPlugins/typed/traits.d.ts → common/grapesBlocks/commands/deviceCommands.d.ts} +0 -0
  161. /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContainer.js +0 -0
  162. /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContent.js +0 -0
  163. /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContents.js +0 -0
  164. /package/dist/{wysiwyg/editorPlugins/tabs → common/grapesBlocks}/types.js +0 -0
@@ -1,18 +0,0 @@
1
- import { traitStringId } from "./utils.js";
2
- var traits_default = (editor) => {
3
- editor.TraitManager.addType(traitStringId, {
4
- createInput({ component }) {
5
- return `<textarea>${component.get("strings").join("\n")}</textarea>`;
6
- },
7
- onUpdate({ component, elInput }) {
8
- elInput.value = component.get("strings").join("\n");
9
- },
10
- onEvent({ component, elInput }) {
11
- const value = (elInput.value || "").split("\n");
12
- component.set("strings", value);
13
- }
14
- });
15
- };
16
- export {
17
- traits_default as default
18
- };
@@ -1,2 +0,0 @@
1
- export declare const cmpId = "typed";
2
- export declare const traitStringId = "typed-strings";
@@ -1,6 +0,0 @@
1
- const cmpId = "typed";
2
- const traitStringId = "typed-strings";
3
- export {
4
- cmpId,
5
- traitStringId
6
- };
@@ -1,20 +0,0 @@
1
- /**
2
- * These triple-slash directives defines dependencies to various declaration files that will be
3
- * loaded when a user imports the StudioCMS plugin in their Astro configuration file. These
4
- * directives must be first at the top of the file and can only be preceded by this comment.
5
- */
6
- /// <reference types="./virtual.d.ts" preserve="true" />
7
- import { type StudioCMSPlugin } from 'studiocms/plugins';
8
- import type { SanitizeOptions } from 'ultrahtml/transformers/sanitize';
9
- /**
10
- * Represents the configuration options for the StudioCMS WYSIWYG Plugin.
11
- */
12
- export type StudioCMSWYSIWYGOptions = {
13
- /** Options passed to the HTML Transformer during rendering */
14
- sanitize?: SanitizeOptions;
15
- };
16
- /**
17
- * StudioCMS WYSIWYG Editor
18
- */
19
- declare function studiocmsWYSIWYG(options?: StudioCMSWYSIWYGOptions): StudioCMSPlugin;
20
- export default studiocmsWYSIWYG;
@@ -1,47 +0,0 @@
1
- import { createResolver } from "astro-integration-kit";
2
- import { definePlugin } from "studiocms/plugins";
3
- import { shared } from "./shared.js";
4
- function studiocmsWYSIWYG(options) {
5
- const { resolve } = createResolver(import.meta.url);
6
- const packageIdentifier = "@studiocms/wysiwyg";
7
- return definePlugin({
8
- identifier: packageIdentifier,
9
- name: "StudioCMS WYSIWYG Editor",
10
- studiocmsMinimumVersion: "0.1.0-beta.18",
11
- hooks: {
12
- "studiocms:astro:config": ({ addIntegrations }) => {
13
- addIntegrations({
14
- name: packageIdentifier,
15
- hooks: {
16
- "astro:config:setup": (params) => {
17
- params.injectRoute({
18
- entrypoint: resolve("./routes/partial.astro"),
19
- pattern: "/studiocms_api/wysiwyg_editor/partial",
20
- prerender: false
21
- });
22
- },
23
- "astro:config:done": () => {
24
- shared.sanitize = options?.sanitize || {};
25
- }
26
- }
27
- });
28
- },
29
- "studiocms:config:setup": ({ setRendering }) => {
30
- setRendering({
31
- pageTypes: [
32
- {
33
- identifier: "studiocms/wysiwyg",
34
- label: "WYSIWYG",
35
- rendererComponent: resolve("./components/Render.astro"),
36
- pageContentComponent: resolve("./components/Editor.astro")
37
- }
38
- ]
39
- });
40
- }
41
- }
42
- });
43
- }
44
- var wysiwyg_default = studiocmsWYSIWYG;
45
- export {
46
- wysiwyg_default as default
47
- };
@@ -1,27 +0,0 @@
1
- ---
2
- export const partial = true;
3
- import { importComponentsKeys } from 'studiocms/lib/renderer/runtime.js';
4
-
5
- // Import components
6
- const components = await importComponentsKeys();
7
-
8
- const data = await Astro.request.json();
9
- if (!data || typeof data.componentKey !== 'string') {
10
- return new Response(JSON.stringify({ error: 'Missing or invalid componentKey' }), {
11
- status: 400,
12
- headers: { 'Content-Type': 'application/json' },
13
- });
14
- }
15
- const { componentKey } = data;
16
-
17
- const Component = components[componentKey];
18
-
19
- // Handle case where component doesn't exist
20
- if (!Component) {
21
- return new Response(JSON.stringify({ error: `Component "${componentKey}" not found` }), {
22
- status: 404,
23
- headers: { 'Content-Type': 'application/json' },
24
- });
25
- }
26
- ---
27
- <Component />
@@ -1,7 +0,0 @@
1
- const shared = globalThis.studiocmsWYSIWYG || // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
2
- (globalThis.studiocmsWYSIWYG = {
3
- sanitize: {}
4
- });
5
- export {
6
- shared
7
- };
@@ -1,52 +0,0 @@
1
- .editor-container {
2
- display: flex;
3
- height: 80dvh !important;
4
- width: 100%;
5
- border: 2px solid hsl(var(--border));
6
- }
7
- .editor {
8
- display: flex;
9
- height: 80dvh !important;
10
- flex-direction: column;
11
- width: 100%;
12
- }
13
- .gjs-one-bg {
14
- background-color: hsl(var(--background-step-3));
15
- }
16
- .gjs-two-color {
17
- color: hsl(var(--text-normal));
18
- }
19
- .gjs-three-bg {
20
- background-color: hsl(var(--background-base));
21
- color: hsl(var(--text-muted));
22
- }
23
- .gjs-four-color,
24
- .gjs-four-color-h:hover {
25
- color: hsl(var(--primary-base));
26
- }
27
- [data-tooltip]::after {
28
- background: rgba(51, 51, 51, 0.9);
29
- }
30
- .gjs-pn-commands {
31
- min-height: 40px;
32
- }
33
- #gjs-sm-float {
34
- display: none;
35
- }
36
- .gjs-logo-version {
37
- background-color: #756467;
38
- }
39
- .gjs-pn-btn.gjs-pn-active {
40
- box-shadow: none;
41
- }
42
- .CodeMirror {
43
- min-height: 450px;
44
- margin-bottom: 8px;
45
- }
46
- .grp-handler-close {
47
- background-color: transparent;
48
- color: #ddd;
49
- }
50
- .grp-handler-cp-wrap {
51
- border-color: transparent;
52
- }
@@ -1,3 +0,0 @@
1
- declare module 'virtual:studiocms/plugins/renderers' {
2
- export const studiocms_wysiwyg: typeof import('./components/Render.astro').default;
3
- }