@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.
- package/LICENSE +1 -1
- package/README.md +7 -28
- package/dist/common/gjs-blocks.d.ts +4 -0
- package/dist/common/gjs-blocks.js +27 -0
- package/dist/common/gjs-componentRegistry.d.ts +31 -0
- package/dist/common/gjs-componentRegistry.js +59 -0
- package/dist/common/gjs-editor-settings.d.ts +23 -0
- package/dist/common/gjs-editor-settings.js +357 -0
- package/dist/common/gjs-editor-utils.d.ts +165 -0
- package/dist/common/gjs-editor-utils.js +217 -0
- package/dist/common/grapesBlocks/blocks/basics.d.ts +4 -0
- package/dist/common/grapesBlocks/blocks/basics.js +279 -0
- package/dist/common/grapesBlocks/blocks/extras.d.ts +4 -0
- package/dist/common/grapesBlocks/blocks/extras.js +63 -0
- package/dist/common/grapesBlocks/blocks/forms.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins/forms/blocks.js → common/grapesBlocks/blocks/forms.js} +15 -14
- package/dist/common/grapesBlocks/blocks/index.d.ts +5 -0
- package/dist/common/grapesBlocks/blocks/index.js +23 -0
- package/dist/common/grapesBlocks/blocks/tabs.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins/tabs/blocks.js → common/grapesBlocks/blocks/tabs.js} +9 -8
- package/dist/common/grapesBlocks/commands/clear.d.ts +4 -0
- package/dist/common/grapesBlocks/commands/clear.js +21 -0
- package/dist/common/grapesBlocks/commands/customCodeCommands.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins/code/commands.js → common/grapesBlocks/commands/customCodeCommands.js} +11 -9
- package/dist/common/grapesBlocks/commands/deviceCommands.js +23 -0
- package/dist/common/grapesBlocks/commands/index.d.ts +5 -0
- package/dist/common/grapesBlocks/commands/index.js +40 -0
- package/dist/common/grapesBlocks/commands/openImport.d.ts +4 -0
- package/dist/common/grapesBlocks/commands/openImport.js +71 -0
- package/dist/common/grapesBlocks/components/countdown.d.ts +12 -0
- package/dist/common/grapesBlocks/components/countdown.js +147 -0
- package/dist/common/grapesBlocks/components/customCode.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins/code/components.js → common/grapesBlocks/components/customCode.js} +16 -15
- package/dist/common/grapesBlocks/components/forms.d.ts +3 -0
- package/dist/{wysiwyg/editorPlugins/forms/components.js → common/grapesBlocks/components/forms.js} +30 -36
- package/dist/common/grapesBlocks/components/index.d.ts +5 -0
- package/dist/common/grapesBlocks/components/index.js +23 -0
- package/dist/common/grapesBlocks/components/tabLoader.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins/tabs/components/index.js → common/grapesBlocks/components/tabLoader.js} +7 -7
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tab.d.ts +1 -1
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tab.js +2 -2
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContainer.d.ts +1 -1
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContent.d.ts +1 -1
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContents.d.ts +1 -1
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tabs.d.ts +1 -1
- package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/Tabs.js +8 -8
- package/dist/common/grapesBlocks/components/tooltip.d.ts +4 -0
- package/dist/{wysiwyg/editorPlugins → common/grapesBlocks/components}/tooltip.js +15 -87
- package/dist/common/grapesBlocks/components/typed.d.ts +9 -0
- package/dist/{wysiwyg/editorPlugins/typed/components.js → common/grapesBlocks/components/typed.js} +7 -7
- package/dist/common/grapesBlocks/consts.d.ts +25 -0
- package/dist/common/grapesBlocks/consts.js +245 -0
- package/dist/common/grapesBlocks/i18n/index.d.ts +3 -0
- package/dist/common/grapesBlocks/i18n/index.js +19 -0
- package/dist/common/grapesBlocks/panels/index.d.ts +4 -0
- package/dist/common/grapesBlocks/panels/index.js +171 -0
- package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/colorPicker.d.ts +9 -0
- package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/colorPicker.js +16 -2
- package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/index.d.ts +3 -3
- package/dist/{wysiwyg/editorPlugins → common/grapesBlocks}/rte/index.js +18 -12
- package/dist/common/grapesBlocks/selectors/index.d.ts +4 -0
- package/dist/common/grapesBlocks/selectors/index.js +9 -0
- package/dist/common/grapesBlocks/selectors/tooltip.d.ts +4 -0
- package/dist/common/grapesBlocks/selectors/tooltip.js +15 -0
- package/dist/common/grapesBlocks/traits/formTraits.d.ts +3 -0
- package/dist/{wysiwyg/editorPlugins/forms/traits.js → common/grapesBlocks/traits/formTraits.js} +12 -8
- package/dist/common/grapesBlocks/traits/index.d.ts +4 -0
- package/dist/common/grapesBlocks/traits/index.js +15 -0
- package/dist/common/grapesBlocks/traits/typedTraits.d.ts +3 -0
- package/dist/common/grapesBlocks/traits/typedTraits.js +24 -0
- package/dist/{wysiwyg/editorPlugins/tuiImageEditor.d.ts → common/grapesBlocks/tuiImageEditor/index.d.ts} +2 -2
- package/dist/{wysiwyg/editorPlugins/tuiImageEditor.js → common/grapesBlocks/tuiImageEditor/index.js} +6 -7
- package/dist/common/grapesBlocks/types.d.ts +446 -0
- package/dist/components/Editor.astro +153 -0
- package/dist/components/render.d.ts +15 -0
- package/dist/components/render.js +11 -0
- package/dist/consts.d.ts +31 -0
- package/dist/consts.js +15 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +71 -0
- package/dist/lib/db.d.ts +83 -0
- package/dist/lib/db.js +50 -0
- package/dist/lib/prerender.d.ts +10 -0
- package/dist/lib/prerender.js +22 -0
- package/dist/{wysiwyg → lib}/shared.d.ts +3 -6
- package/dist/lib/shared.js +6 -0
- package/dist/{utils.d.ts → lib/utils.d.ts} +1 -1
- package/dist/lib/utils.js +10 -0
- package/dist/routes/grapes.css.d.ts +7 -0
- package/dist/routes/grapes.css.js +13 -0
- package/dist/routes/partial.astro +44 -0
- package/dist/routes/store.d.ts +1 -0
- package/dist/routes/store.js +121 -0
- package/dist/schema.d.ts +60 -0
- package/dist/schema.js +24 -0
- package/dist/styles/editor.css +150 -0
- package/dist/styles/grapes.css +71 -0
- package/dist/types.d.ts +66 -0
- package/dist/types.js +9 -0
- package/package.json +30 -28
- package/dist/common/prepareRender.d.ts +0 -11
- package/dist/common/prepareRender.js +0 -24
- package/dist/studio/components/Render.astro +0 -11
- package/dist/studio/components/StudioSDKEditor.astro +0 -334
- package/dist/studio/index.d.ts +0 -38
- package/dist/studio/index.js +0 -58
- package/dist/studio/routes/partial.astro +0 -27
- package/dist/studio/shared.d.ts +0 -17
- package/dist/studio/shared.js +0 -7
- package/dist/studio/utils.d.ts +0 -105
- package/dist/studio/utils.js +0 -244
- package/dist/studio/virtual.d.ts +0 -114
- package/dist/utils.js +0 -15
- package/dist/wysiwyg/components/Editor.astro +0 -765
- package/dist/wysiwyg/components/Render.astro +0 -11
- package/dist/wysiwyg/editorPlugins/blocks/blocks.d.ts +0 -3
- package/dist/wysiwyg/editorPlugins/blocks/blocks.js +0 -239
- package/dist/wysiwyg/editorPlugins/blocks/index.d.ts +0 -80
- package/dist/wysiwyg/editorPlugins/blocks/index.js +0 -26
- package/dist/wysiwyg/editorPlugins/code/blocks.d.ts +0 -4
- package/dist/wysiwyg/editorPlugins/code/blocks.js +0 -20
- package/dist/wysiwyg/editorPlugins/code/commands.d.ts +0 -4
- package/dist/wysiwyg/editorPlugins/code/components.d.ts +0 -4
- package/dist/wysiwyg/editorPlugins/code/index.d.ts +0 -47
- package/dist/wysiwyg/editorPlugins/code/index.js +0 -28
- package/dist/wysiwyg/editorPlugins/code/utils.d.ts +0 -3
- package/dist/wysiwyg/editorPlugins/code/utils.js +0 -8
- package/dist/wysiwyg/editorPlugins/countdown.d.ts +0 -86
- package/dist/wysiwyg/editorPlugins/countdown.js +0 -163
- package/dist/wysiwyg/editorPlugins/forms/blocks.d.ts +0 -3
- package/dist/wysiwyg/editorPlugins/forms/components.d.ts +0 -11
- package/dist/wysiwyg/editorPlugins/forms/index.d.ts +0 -21
- package/dist/wysiwyg/editorPlugins/forms/index.js +0 -18
- package/dist/wysiwyg/editorPlugins/forms/traits.d.ts +0 -2
- package/dist/wysiwyg/editorPlugins/index.d.ts +0 -9
- package/dist/wysiwyg/editorPlugins/index.js +0 -20
- package/dist/wysiwyg/editorPlugins/rte/styles.css +0 -63
- package/dist/wysiwyg/editorPlugins/tabs/blocks.d.ts +0 -3
- package/dist/wysiwyg/editorPlugins/tabs/components/index.d.ts +0 -4
- package/dist/wysiwyg/editorPlugins/tabs/index.d.ts +0 -5
- package/dist/wysiwyg/editorPlugins/tabs/index.js +0 -15
- package/dist/wysiwyg/editorPlugins/tabs/options.d.ts +0 -5
- package/dist/wysiwyg/editorPlugins/tabs/options.js +0 -80
- package/dist/wysiwyg/editorPlugins/tabs/types.d.ts +0 -81
- package/dist/wysiwyg/editorPlugins/tooltip.d.ts +0 -68
- package/dist/wysiwyg/editorPlugins/typed/blocks.d.ts +0 -4
- package/dist/wysiwyg/editorPlugins/typed/blocks.js +0 -15
- package/dist/wysiwyg/editorPlugins/typed/components.d.ts +0 -9
- package/dist/wysiwyg/editorPlugins/typed/index.d.ts +0 -35
- package/dist/wysiwyg/editorPlugins/typed/index.js +0 -18
- package/dist/wysiwyg/editorPlugins/typed/traits.js +0 -18
- package/dist/wysiwyg/editorPlugins/typed/utils.d.ts +0 -2
- package/dist/wysiwyg/editorPlugins/typed/utils.js +0 -6
- package/dist/wysiwyg/index.d.ts +0 -20
- package/dist/wysiwyg/index.js +0 -47
- package/dist/wysiwyg/routes/partial.astro +0 -27
- package/dist/wysiwyg/shared.js +0 -7
- package/dist/wysiwyg/styles/main.css +0 -52
- package/dist/wysiwyg/virtual.d.ts +0 -3
- /package/dist/{wysiwyg/editorPlugins/typed/traits.d.ts → common/grapesBlocks/commands/deviceCommands.d.ts} +0 -0
- /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContainer.js +0 -0
- /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContent.js +0 -0
- /package/dist/{wysiwyg/editorPlugins/tabs/components → common/grapesBlocks/components/tabs}/TabContents.js +0 -0
- /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
|
-
};
|
package/dist/wysiwyg/index.d.ts
DELETED
|
@@ -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;
|
package/dist/wysiwyg/index.js
DELETED
|
@@ -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 />
|
package/dist/wysiwyg/shared.js
DELETED
|
@@ -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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|