@studiocms/wysiwyg 0.1.0-experimental.5 → 0.1.0
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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { apiResponseLogger } from "studiocms:logger";
|
|
2
|
+
import {
|
|
3
|
+
AllResponse,
|
|
4
|
+
Cause,
|
|
5
|
+
createEffectAPIRoutes,
|
|
6
|
+
createJsonResponse,
|
|
7
|
+
Effect,
|
|
8
|
+
genLogger,
|
|
9
|
+
OptionsResponse,
|
|
10
|
+
ParseResult,
|
|
11
|
+
Schema
|
|
12
|
+
} from "studiocms/effect";
|
|
13
|
+
import { CSRF_COOKIE_NAME, CSRF_HEADER_NAME } from "../consts.js";
|
|
14
|
+
import { UseSDK } from "../lib/db.js";
|
|
15
|
+
const POSTJsonSchema = (schema) => Schema.Struct({
|
|
16
|
+
projectId: Schema.String,
|
|
17
|
+
data: Schema.mutable(schema)
|
|
18
|
+
});
|
|
19
|
+
const parsePOSTJsonRequest = (context, schema) => Effect.tryPromise(() => context.request.json()).pipe(
|
|
20
|
+
Effect.flatMap((data) => Schema.decodeUnknown(POSTJsonSchema(schema))(data)),
|
|
21
|
+
Effect.mapError((error) => {
|
|
22
|
+
console.error("Error parsing POST JSON request:", error);
|
|
23
|
+
if (error instanceof ParseResult.ParseError) {
|
|
24
|
+
return new Error(`Invalid request data: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
if (error instanceof Cause.UnknownException) {
|
|
27
|
+
return new Error(`Unknown error occurred: ${error.message}`);
|
|
28
|
+
}
|
|
29
|
+
return new Error("Failed to parse request data: Unknown error");
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
const handleCSRF = ({ request, cookies }) => Effect.try(() => {
|
|
33
|
+
const submittedToken = request.headers.get(CSRF_HEADER_NAME);
|
|
34
|
+
const storedToken = cookies.get(CSRF_COOKIE_NAME)?.value;
|
|
35
|
+
if (!submittedToken || !storedToken || submittedToken !== storedToken) {
|
|
36
|
+
console.warn("CSRF token validation failed");
|
|
37
|
+
return apiResponseLogger(403, "CSRF token validation failed");
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const handleUserSessionVerification = ({ locals }) => Effect.try(() => {
|
|
41
|
+
const userData = locals.StudioCMS.security?.userSessionData.isLoggedIn;
|
|
42
|
+
if (!userData) {
|
|
43
|
+
console.warn("User is not logged in, returning 403 Unauthorized");
|
|
44
|
+
return apiResponseLogger(403, "Unauthorized");
|
|
45
|
+
}
|
|
46
|
+
const isAuthorized = locals.StudioCMS.security?.userPermissionLevel.isEditor;
|
|
47
|
+
if (!isAuthorized) {
|
|
48
|
+
console.warn("User does not have editor permissions, returning 403 Unauthorized");
|
|
49
|
+
return apiResponseLogger(403, "Unauthorized");
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const apiChecks = Effect.fn(function* (context) {
|
|
53
|
+
const userCheck = yield* handleUserSessionVerification(context);
|
|
54
|
+
if (userCheck instanceof Response) {
|
|
55
|
+
return userCheck;
|
|
56
|
+
}
|
|
57
|
+
const csrfCheck = yield* handleCSRF(context);
|
|
58
|
+
if (csrfCheck instanceof Response) {
|
|
59
|
+
return csrfCheck;
|
|
60
|
+
}
|
|
61
|
+
return void 0;
|
|
62
|
+
});
|
|
63
|
+
const { GET, POST, OPTIONS, ALL } = createEffectAPIRoutes(
|
|
64
|
+
{
|
|
65
|
+
GET: (ctx) => genLogger("@studiocms/wysiwyg/routes/store:GET")(function* () {
|
|
66
|
+
const { load } = yield* UseSDK;
|
|
67
|
+
const securityCheck = yield* apiChecks(ctx);
|
|
68
|
+
if (securityCheck instanceof Response) {
|
|
69
|
+
return securityCheck;
|
|
70
|
+
}
|
|
71
|
+
const searchParams = ctx.url.searchParams;
|
|
72
|
+
const projectId = searchParams.get("projectId");
|
|
73
|
+
if (!projectId) {
|
|
74
|
+
return apiResponseLogger(400, "Project ID is required");
|
|
75
|
+
}
|
|
76
|
+
const projectData = yield* load(projectId);
|
|
77
|
+
if (!projectData) {
|
|
78
|
+
return apiResponseLogger(404, "Project not found");
|
|
79
|
+
}
|
|
80
|
+
return new Response(JSON.stringify(projectData), {
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "application/json",
|
|
83
|
+
"Cache-Control": "no-store, private"
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}),
|
|
87
|
+
POST: (ctx) => genLogger("@studiocms/wysiwyg/routes/store:POST")(function* () {
|
|
88
|
+
const { store, types } = yield* UseSDK;
|
|
89
|
+
const securityCheck = yield* apiChecks(ctx);
|
|
90
|
+
if (securityCheck instanceof Response) {
|
|
91
|
+
return securityCheck;
|
|
92
|
+
}
|
|
93
|
+
const { projectId, data } = yield* parsePOSTJsonRequest(ctx, types._Schema);
|
|
94
|
+
const result = yield* store(projectId, data);
|
|
95
|
+
if (!result) {
|
|
96
|
+
return apiResponseLogger(500, "Failed to store project data");
|
|
97
|
+
}
|
|
98
|
+
return apiResponseLogger(200, "Project data stored successfully");
|
|
99
|
+
}),
|
|
100
|
+
OPTIONS: () => Effect.try(() => OptionsResponse({ allowedMethods: ["GET", "POST"] })),
|
|
101
|
+
ALL: () => Effect.try(() => AllResponse())
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
cors: { methods: ["GET", "POST", "OPTIONS"] },
|
|
105
|
+
onError: (error) => {
|
|
106
|
+
console.error("API Error:", error);
|
|
107
|
+
return createJsonResponse(
|
|
108
|
+
{ error: "Internal Server Error" },
|
|
109
|
+
{
|
|
110
|
+
status: 500
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
export {
|
|
117
|
+
ALL,
|
|
118
|
+
GET,
|
|
119
|
+
OPTIONS,
|
|
120
|
+
POST
|
|
121
|
+
};
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Schema } from 'studiocms/effect';
|
|
2
|
+
/**
|
|
3
|
+
* Schema definition for an array containing elements of any type.
|
|
4
|
+
*
|
|
5
|
+
* This schema allows for arrays that can contain any type of elements,
|
|
6
|
+
*/
|
|
7
|
+
export declare const AnyArray: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
8
|
+
/**
|
|
9
|
+
* Schema definition for a mutable string.
|
|
10
|
+
*
|
|
11
|
+
* This schema allows for strings that can be modified after creation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MString: Schema.mutable<typeof Schema.String>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a mutable schema for a struct with the specified fields.
|
|
16
|
+
*
|
|
17
|
+
* @template F - The fields of the struct.
|
|
18
|
+
* @returns A mutable schema for the struct with the given fields.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MStruct: <F extends Schema.Struct.Fields>(fields: F) => Schema.mutable<Schema.Struct<F>>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a mutable array schema for elements of type `V`.
|
|
23
|
+
* @template V - The type of elements in the array.
|
|
24
|
+
* @returns A mutable schema for an array containing elements of type `V`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MArray: <V extends Schema.Schema.Any>(val: V) => Schema.mutable<Schema.Array$<V>>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a mutable record schema with specified key and value types.
|
|
29
|
+
*
|
|
30
|
+
* @template K - The type of the keys in the record.
|
|
31
|
+
* @template V - The type of the values in the record.
|
|
32
|
+
* @param opts - An object containing the key and value types.
|
|
33
|
+
* @returns A mutable schema for a record with specified key and value types.
|
|
34
|
+
*/
|
|
35
|
+
export declare const MRecord: <K extends Schema.Schema.All, V extends Schema.Schema.All>(opts: {
|
|
36
|
+
readonly key: K;
|
|
37
|
+
readonly value: V;
|
|
38
|
+
}) => Schema.mutable<Schema.Record$<K, V>>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a mutable array schema for a struct with specified fields.
|
|
41
|
+
*
|
|
42
|
+
* @template F - The fields of the struct.
|
|
43
|
+
* @returns A mutable schema for an array containing structs with the specified fields.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MArrayStruct: <F extends Schema.Struct.Fields>(fields: F) => Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<F>>>>;
|
|
46
|
+
/**
|
|
47
|
+
* Schema definition for StudioCMS project data.
|
|
48
|
+
*
|
|
49
|
+
* This schema describes the structure of the project data used in StudioCMS,
|
|
50
|
+
* including optional HTML content, data sources, assets, styles, symbols, and pages.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export declare const studioCMSProjectDataSchema: Schema.Struct<{
|
|
54
|
+
dataSources: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
55
|
+
assets: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
56
|
+
styles: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
57
|
+
symbols: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
58
|
+
pages: Schema.mutable<Schema.Array$<typeof Schema.Unknown>>;
|
|
59
|
+
__STUDIOCMS_HTML: Schema.optional<Schema.mutable<typeof Schema.String>>;
|
|
60
|
+
}>;
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Schema } from "studiocms/effect";
|
|
2
|
+
const AnyArray = Schema.mutable(Schema.Array(Schema.Unknown));
|
|
3
|
+
const MString = Schema.mutable(Schema.String);
|
|
4
|
+
const MStruct = (fields) => Schema.mutable(Schema.Struct(fields));
|
|
5
|
+
const MArray = (val) => Schema.mutable(Schema.Array(val));
|
|
6
|
+
const MRecord = (opts) => Schema.mutable(Schema.Record(opts));
|
|
7
|
+
const MArrayStruct = (fields) => MArray(MStruct(fields));
|
|
8
|
+
const studioCMSProjectDataSchema = Schema.Struct({
|
|
9
|
+
dataSources: AnyArray,
|
|
10
|
+
assets: AnyArray,
|
|
11
|
+
styles: AnyArray,
|
|
12
|
+
symbols: AnyArray,
|
|
13
|
+
pages: AnyArray,
|
|
14
|
+
__STUDIOCMS_HTML: Schema.optional(MString)
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
AnyArray,
|
|
18
|
+
MArray,
|
|
19
|
+
MArrayStruct,
|
|
20
|
+
MRecord,
|
|
21
|
+
MString,
|
|
22
|
+
MStruct,
|
|
23
|
+
studioCMSProjectDataSchema
|
|
24
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--gjs-color-blue: hsl(259, 55%, 60%);
|
|
3
|
+
}
|
|
4
|
+
.save-indicator {
|
|
5
|
+
stroke: var(--text-normal);
|
|
6
|
+
transition: stroke 150ms ease-in-out;
|
|
7
|
+
}
|
|
8
|
+
.save-indicator.dirty {
|
|
9
|
+
stroke: var(--warning-base);
|
|
10
|
+
}
|
|
11
|
+
.save-indicator .dirty-indicator {
|
|
12
|
+
display: none;
|
|
13
|
+
transition: all 150ms ease-in-out;
|
|
14
|
+
}
|
|
15
|
+
.save-indicator.dirty .dirty-indicator {
|
|
16
|
+
display: block !important;
|
|
17
|
+
}
|
|
18
|
+
.scms-grapesjs-container {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
min-height: 80vh;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
border: 2px solid var(--border);
|
|
24
|
+
border-radius: var(--radius-md);
|
|
25
|
+
font-family:
|
|
26
|
+
Inter,
|
|
27
|
+
system-ui,
|
|
28
|
+
Avenir,
|
|
29
|
+
Helvetica,
|
|
30
|
+
Arial,
|
|
31
|
+
sans-serif;
|
|
32
|
+
line-height: 1.5;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
font-synthesis: none;
|
|
35
|
+
text-rendering: optimizeLegibility;
|
|
36
|
+
-webkit-font-smoothing: antialiased;
|
|
37
|
+
-moz-osx-font-smoothing: grayscale;
|
|
38
|
+
}
|
|
39
|
+
.scms-grapesjs-container .editor {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
}
|
|
43
|
+
.scms-grapesjs-container .editor #gjs {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
}
|
|
48
|
+
.gjs-one-bg {
|
|
49
|
+
background-color: var(--background-step-3);
|
|
50
|
+
}
|
|
51
|
+
.gjs-two-color {
|
|
52
|
+
color: var(--text-normal);
|
|
53
|
+
}
|
|
54
|
+
.gjs-three-bg {
|
|
55
|
+
background-color: var(--background-base);
|
|
56
|
+
color: var(--text-muted);
|
|
57
|
+
}
|
|
58
|
+
.gjs-four-color,
|
|
59
|
+
.gjs-four-color-h:hover {
|
|
60
|
+
color: var(--primary-base);
|
|
61
|
+
}
|
|
62
|
+
[data-tooltip]::after {
|
|
63
|
+
background: rgba(51, 51, 51, 0.9);
|
|
64
|
+
}
|
|
65
|
+
.gjs-pn-commands {
|
|
66
|
+
min-height: 40px;
|
|
67
|
+
}
|
|
68
|
+
#gjs-sm-float {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
.gjs-logo-version {
|
|
72
|
+
background-color: #756467;
|
|
73
|
+
}
|
|
74
|
+
.gjs-pn-btn.gjs-pn-active {
|
|
75
|
+
box-shadow: none;
|
|
76
|
+
}
|
|
77
|
+
.CodeMirror {
|
|
78
|
+
min-height: 450px;
|
|
79
|
+
margin-bottom: 8px;
|
|
80
|
+
}
|
|
81
|
+
.grp-handler-close {
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
color: #ddd;
|
|
84
|
+
}
|
|
85
|
+
.grp-handler-cp-wrap {
|
|
86
|
+
border-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
.gjs-rte-toolbar {
|
|
89
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.44);
|
|
90
|
+
border-radius: 3px;
|
|
91
|
+
}
|
|
92
|
+
.gjs-rte-action {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
border-right: none;
|
|
95
|
+
padding: 10px;
|
|
96
|
+
min-width: 35px;
|
|
97
|
+
}
|
|
98
|
+
.gjs-rte-actionbar {
|
|
99
|
+
max-width: 600px;
|
|
100
|
+
flex-wrap: wrap;
|
|
101
|
+
}
|
|
102
|
+
.rte-hilite-btn {
|
|
103
|
+
padding: 3px 6px;
|
|
104
|
+
border-radius: 3px;
|
|
105
|
+
background: rgba(210, 120, 201, 0.3);
|
|
106
|
+
}
|
|
107
|
+
.rte-color-picker {
|
|
108
|
+
display: none;
|
|
109
|
+
padding: 10px;
|
|
110
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.34);
|
|
111
|
+
border-radius: 5px;
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 55px;
|
|
114
|
+
width: 250px;
|
|
115
|
+
transition: all 2s ease;
|
|
116
|
+
}
|
|
117
|
+
.rte-color-picker:before {
|
|
118
|
+
content: "";
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: -20px;
|
|
121
|
+
left: 46%;
|
|
122
|
+
border-width: 10px;
|
|
123
|
+
border-style: solid;
|
|
124
|
+
}
|
|
125
|
+
.rte-color-picker.dark {
|
|
126
|
+
background: rgba(0, 0, 0, 0.8);
|
|
127
|
+
}
|
|
128
|
+
.rte-color-picker.dark:before {
|
|
129
|
+
border-color: transparent transparent rgba(0, 0, 0, 0.75) transparent;
|
|
130
|
+
}
|
|
131
|
+
.rte-color-picker.light {
|
|
132
|
+
background: rgba(255, 255, 255, 0.75);
|
|
133
|
+
}
|
|
134
|
+
.rte-color-picker.light:before {
|
|
135
|
+
border-color: transparent transparent rgba(255, 255, 255, 0.75) transparent;
|
|
136
|
+
}
|
|
137
|
+
.rte-color-picker > div {
|
|
138
|
+
width: 30px;
|
|
139
|
+
display: inline-block;
|
|
140
|
+
height: 30px;
|
|
141
|
+
margin: 5px;
|
|
142
|
+
border-radius: 100%;
|
|
143
|
+
opacity: 0.7;
|
|
144
|
+
}
|
|
145
|
+
.rte-color-picker > div:hover {
|
|
146
|
+
opacity: 1;
|
|
147
|
+
}
|
|
148
|
+
.picker-wrapper {
|
|
149
|
+
padding: 20px;
|
|
150
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--gjs-color-blue: hsl(259 73% 67%);
|
|
3
|
+
body {
|
|
4
|
+
background-color: hsl(0, 0%, 97%);
|
|
5
|
+
}
|
|
6
|
+
* ::-webkit-scrollbar-track {
|
|
7
|
+
background: rgba(0, 0, 0, 0.1);
|
|
8
|
+
}
|
|
9
|
+
* ::-webkit-scrollbar-thumb {
|
|
10
|
+
background: rgba(255, 255, 255, 0.2);
|
|
11
|
+
}
|
|
12
|
+
* ::-webkit-scrollbar {
|
|
13
|
+
width: 10px;
|
|
14
|
+
}
|
|
15
|
+
[data-gjs-type=wrapper] {
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
padding-top: 0.001em;
|
|
18
|
+
}
|
|
19
|
+
.gjs-dashed *[data-gjs-highlightable] {
|
|
20
|
+
outline: 1px dashed rgba(170, 170, 170, 0.7);
|
|
21
|
+
outline-offset: -2px;
|
|
22
|
+
}
|
|
23
|
+
.gjs-selected {
|
|
24
|
+
outline: 2px solid hsl(259 73% 67%) !important;
|
|
25
|
+
outline-offset: -2px;
|
|
26
|
+
}
|
|
27
|
+
.gjs-selected-parent {
|
|
28
|
+
outline: 2px solid hsl(48 100% 61%) !important;
|
|
29
|
+
}
|
|
30
|
+
.gjs-no-select {
|
|
31
|
+
user-select: none;
|
|
32
|
+
-webkit-user-select: none;
|
|
33
|
+
-moz-user-select: none;
|
|
34
|
+
}
|
|
35
|
+
.gjs-freezed {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
.gjs-no-pointer {
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
.gjs-pointer-init {
|
|
43
|
+
pointer-events: initial;
|
|
44
|
+
}
|
|
45
|
+
.gjs-plh-image {
|
|
46
|
+
background: #f5f5f5;
|
|
47
|
+
border: none;
|
|
48
|
+
height: 100px;
|
|
49
|
+
width: 100px;
|
|
50
|
+
display: block;
|
|
51
|
+
outline: 3px solid hsl(48 100% 61%);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
outline-offset: -2px;
|
|
54
|
+
}
|
|
55
|
+
.gjs-grabbing {
|
|
56
|
+
cursor: grabbing;
|
|
57
|
+
}
|
|
58
|
+
.gjs-is__grabbing {
|
|
59
|
+
overflow-x: hidden;
|
|
60
|
+
}
|
|
61
|
+
.gjs-is__grabbing,
|
|
62
|
+
.gjs-is__grabbing * {
|
|
63
|
+
cursor: grabbing !important;
|
|
64
|
+
}
|
|
65
|
+
* {
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
}
|
|
68
|
+
body {
|
|
69
|
+
margin: 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
import type { Schema } from 'studiocms/effect';
|
|
3
|
+
import type { studioCMSProjectDataSchema } from './schema.js';
|
|
4
|
+
export interface WysiwygDBContent extends Schema.SimplifyMutable<typeof studioCMSProjectDataSchema.Type> {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Defines the schema for HTML configuration options.
|
|
8
|
+
*
|
|
9
|
+
* The schema includes an optional `sanitize` property, which is validated
|
|
10
|
+
* using the `StudioCMSSanitizeOptionsSchema`. If no value is provided,
|
|
11
|
+
* the default is an empty object.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WYSIWYGSchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
14
|
+
/** Sanitization options for WYSIWYG content. See {@link StudioCMSSanitizeOptionsSchema} for details. */
|
|
15
|
+
sanitize: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
allowElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
blockElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
dropElements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
allowAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
|
|
20
|
+
dropAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
|
|
21
|
+
allowComponents: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
allowCustomElements: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
allowComments: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
allowElements?: string[] | undefined;
|
|
26
|
+
blockElements?: string[] | undefined;
|
|
27
|
+
dropElements?: string[] | undefined;
|
|
28
|
+
allowAttributes?: Record<string, string[]> | undefined;
|
|
29
|
+
dropAttributes?: Record<string, string[]> | undefined;
|
|
30
|
+
allowComponents?: boolean | undefined;
|
|
31
|
+
allowCustomElements?: boolean | undefined;
|
|
32
|
+
allowComments?: boolean | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
allowElements?: string[] | undefined;
|
|
35
|
+
blockElements?: string[] | undefined;
|
|
36
|
+
dropElements?: string[] | undefined;
|
|
37
|
+
allowAttributes?: Record<string, string[]> | undefined;
|
|
38
|
+
dropAttributes?: Record<string, string[]> | undefined;
|
|
39
|
+
allowComponents?: boolean | undefined;
|
|
40
|
+
allowCustomElements?: boolean | undefined;
|
|
41
|
+
allowComments?: boolean | undefined;
|
|
42
|
+
}>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
sanitize?: {
|
|
45
|
+
allowElements?: string[] | undefined;
|
|
46
|
+
blockElements?: string[] | undefined;
|
|
47
|
+
dropElements?: string[] | undefined;
|
|
48
|
+
allowAttributes?: Record<string, string[]> | undefined;
|
|
49
|
+
dropAttributes?: Record<string, string[]> | undefined;
|
|
50
|
+
allowComponents?: boolean | undefined;
|
|
51
|
+
allowCustomElements?: boolean | undefined;
|
|
52
|
+
allowComments?: boolean | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
sanitize?: {
|
|
56
|
+
allowElements?: string[] | undefined;
|
|
57
|
+
blockElements?: string[] | undefined;
|
|
58
|
+
dropElements?: string[] | undefined;
|
|
59
|
+
allowAttributes?: Record<string, string[]> | undefined;
|
|
60
|
+
dropAttributes?: Record<string, string[]> | undefined;
|
|
61
|
+
allowComponents?: boolean | undefined;
|
|
62
|
+
allowCustomElements?: boolean | undefined;
|
|
63
|
+
allowComments?: boolean | undefined;
|
|
64
|
+
} | undefined;
|
|
65
|
+
}>>>;
|
|
66
|
+
export type WYSIWYGSchemaOptions = z.infer<typeof WYSIWYGSchema>;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "astro/zod";
|
|
2
|
+
import { StudioCMSSanitizeOptionsSchema } from "studiocms/schemas";
|
|
3
|
+
const WYSIWYGSchema = z.object({
|
|
4
|
+
/** Sanitization options for WYSIWYG content. See {@link StudioCMSSanitizeOptionsSchema} for details. */
|
|
5
|
+
sanitize: StudioCMSSanitizeOptionsSchema
|
|
6
|
+
}).optional().default({});
|
|
7
|
+
export {
|
|
8
|
+
WYSIWYGSchema
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiocms/wysiwyg",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Add A WYSIWYG Editor to your StudioCMS project with ease!",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "withstudiocms",
|
|
7
7
|
"url": "https://studiocms.dev"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/withstudiocms/
|
|
12
|
-
"directory": "packages/
|
|
11
|
+
"url": "git+https://github.com/withstudiocms/studiocms.git",
|
|
12
|
+
"directory": "packages/@studiocms/wysiwyg"
|
|
13
13
|
},
|
|
14
14
|
"contributors": [
|
|
15
15
|
"Adammatthiesen",
|
|
@@ -23,12 +23,10 @@
|
|
|
23
23
|
"astrocms",
|
|
24
24
|
"astrodb",
|
|
25
25
|
"astrostudio",
|
|
26
|
-
"astro-integration",
|
|
27
26
|
"astro-studio",
|
|
28
27
|
"astro-studiocms",
|
|
29
28
|
"cms",
|
|
30
29
|
"studiocms",
|
|
31
|
-
"withastro",
|
|
32
30
|
"plugin",
|
|
33
31
|
"studiocms-plugin"
|
|
34
32
|
],
|
|
@@ -43,39 +41,43 @@
|
|
|
43
41
|
],
|
|
44
42
|
"exports": {
|
|
45
43
|
".": {
|
|
46
|
-
"types": "./dist/
|
|
47
|
-
"default": "./dist/
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"default": "./dist/index.js"
|
|
48
46
|
},
|
|
49
|
-
"./
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"types": "./dist/studio/index.d.ts",
|
|
53
|
-
"default": "./dist/studio/index.js"
|
|
47
|
+
"./consts": {
|
|
48
|
+
"types": "./dist/consts.d.ts",
|
|
49
|
+
"default": "./dist/consts.js"
|
|
54
50
|
},
|
|
55
|
-
"./
|
|
56
|
-
|
|
51
|
+
"./types": {
|
|
52
|
+
"types": "./dist/types.d.ts",
|
|
53
|
+
"default": "./dist/types.js"
|
|
54
|
+
},
|
|
55
|
+
"./components/*": "./dist/components/*",
|
|
56
|
+
"./routes/*": "./dist/routes/*"
|
|
57
57
|
},
|
|
58
58
|
"type": "module",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"grapesjs": "^0.22.6",
|
|
65
|
-
"ultrahtml": "^1.5.3",
|
|
66
|
-
"tui-image-editor": "^3.15.3",
|
|
67
|
-
"@studiocms/grapesjs-plugin": "0.1.0"
|
|
60
|
+
"astro-integration-kit": "^0.19.1",
|
|
61
|
+
"deepmerge-ts": "^7.1.5",
|
|
62
|
+
"grapesjs": "^0.22.14",
|
|
63
|
+
"tui-image-editor": "^3.15.3"
|
|
68
64
|
},
|
|
69
65
|
"devDependencies": {
|
|
70
66
|
"@types/node": "^22.0.0"
|
|
71
67
|
},
|
|
72
68
|
"peerDependencies": {
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"vite": "^6.
|
|
69
|
+
"@studiocms/ui": "^1.0.0",
|
|
70
|
+
"astro": "^5.12.9",
|
|
71
|
+
"vite": "^6.3.4",
|
|
72
|
+
"@withstudiocms/component-registry": "0.1.0",
|
|
73
|
+
"studiocms": "0.1.0"
|
|
76
74
|
},
|
|
77
75
|
"scripts": {
|
|
78
|
-
"build": "
|
|
79
|
-
"dev": "
|
|
76
|
+
"build": "buildkit build 'src/**/*.{ts,astro,css,js}'",
|
|
77
|
+
"dev": "buildkit dev 'src/**/*.{ts,astro,css,js}'",
|
|
78
|
+
"test": "vitest",
|
|
79
|
+
"effect-check": "pnpm effect-language-service diagnostics --project tsconfig.tspc.json",
|
|
80
|
+
"ci:effect-check": "pnpm effect-check --format github-actions",
|
|
81
|
+
"typecheck": "tspc -p tsconfig.tspc.json"
|
|
80
82
|
}
|
|
81
83
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SSRResult } from 'astro';
|
|
2
|
-
import type { PluginPageTypeRendererProps } from 'studiocms/types';
|
|
3
|
-
import type { SanitizeOptions } from 'ultrahtml/transformers/sanitize';
|
|
4
|
-
/**
|
|
5
|
-
* Prepares HTML content for rendering in the WYSIWYG editor.
|
|
6
|
-
* @param result - The Astro SSR result object
|
|
7
|
-
* @param data - The page data containing content to render
|
|
8
|
-
* @param sanitize - Optional sanitization options for HTML content
|
|
9
|
-
* @returns Transformed HTML ready for rendering
|
|
10
|
-
*/
|
|
11
|
-
export declare function prepareRender(result: SSRResult, data: PluginPageTypeRendererProps['data'], sanitize?: SanitizeOptions | undefined): Promise<string>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { importComponentsKeys } from "studiocms/lib/renderer/runtime.js";
|
|
2
|
-
import { createComponentProxy, transformHTML } from "studiocms/runtime";
|
|
3
|
-
import { parse } from "../utils.js";
|
|
4
|
-
async function prepareRender(result, data, sanitize) {
|
|
5
|
-
const _components = await importComponentsKeys();
|
|
6
|
-
const components = createComponentProxy(result, _components);
|
|
7
|
-
let contentToRender = "<h1>Error: No content found</h1>";
|
|
8
|
-
try {
|
|
9
|
-
if (data.defaultContent?.content) {
|
|
10
|
-
const parsed = parse(data.defaultContent.content);
|
|
11
|
-
if (parsed?.__STUDIOCMS_HTML) {
|
|
12
|
-
contentToRender = parsed.__STUDIOCMS_HTML;
|
|
13
|
-
} else {
|
|
14
|
-
contentToRender = "<h1>Error: Content found but invalid format</h1>";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
} catch (error) {
|
|
18
|
-
contentToRender = `<h1>Error parsing content: ${error instanceof Error ? error.message : "Unknown error"}</h1>`;
|
|
19
|
-
}
|
|
20
|
-
return transformHTML(contentToRender, components, sanitize);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
prepareRender
|
|
24
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { PluginPageTypeRendererProps } from 'studiocms/types';
|
|
3
|
-
import { prepareRender } from '../../common/prepareRender.js';
|
|
4
|
-
import { shared } from '../shared.js';
|
|
5
|
-
|
|
6
|
-
interface Props extends PluginPageTypeRendererProps {}
|
|
7
|
-
|
|
8
|
-
// @ts-expect-error - $$result is a global variable injected by Astro during compilation and not a editor-known variable
|
|
9
|
-
const data = await prepareRender($$result, Astro.props.data, shared?.sanitize);
|
|
10
|
-
---
|
|
11
|
-
<Fragment set:html={data} />
|