@webstudio-is/react-sdk 0.7.3 → 0.9.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/lib/app/custom-components/image.d.ts +9 -0
- package/lib/app/custom-components/image.d.ts.map +1 -0
- package/lib/app/custom-components/image.js +24 -0
- package/lib/app/custom-components/index.d.ts +2 -0
- package/lib/app/custom-components/index.d.ts.map +1 -0
- package/lib/app/custom-components/index.js +1 -0
- package/lib/{cjs/remix → app}/handle-request.server.d.ts +0 -0
- package/lib/app/handle-request.server.d.ts.map +1 -0
- package/lib/{remix → app}/handle-request.server.js +0 -0
- package/lib/{cjs/remix → app}/index.d.ts +1 -0
- package/lib/app/index.d.ts.map +1 -0
- package/lib/{remix → app}/index.js +1 -0
- package/lib/app/params.d.ts +6 -0
- package/lib/app/params.d.ts.map +1 -0
- package/lib/app/params.js +6 -0
- package/lib/{cjs/remix → app}/root.d.ts +1 -0
- package/lib/app/root.d.ts.map +1 -0
- package/lib/{remix → app}/root.js +0 -0
- package/lib/cjs/app/custom-components/image.cjs +27 -0
- package/lib/cjs/app/custom-components/image.d.ts +9 -0
- package/lib/cjs/app/custom-components/image.d.ts.map +1 -0
- package/lib/cjs/app/custom-components/index.cjs +27 -0
- package/lib/cjs/app/custom-components/index.d.ts +2 -0
- package/lib/cjs/app/custom-components/index.d.ts.map +1 -0
- package/lib/cjs/{remix → app}/handle-request.server.cjs +0 -0
- package/lib/{remix → cjs/app}/handle-request.server.d.ts +0 -0
- package/lib/cjs/app/handle-request.server.d.ts.map +1 -0
- package/lib/cjs/{remix → app}/index.cjs +1 -0
- package/lib/{remix → cjs/app}/index.d.ts +1 -0
- package/lib/cjs/app/index.d.ts.map +1 -0
- package/lib/cjs/app/params.cjs +11 -0
- package/lib/cjs/app/params.d.ts +6 -0
- package/lib/cjs/app/params.d.ts.map +1 -0
- package/lib/cjs/{remix → app}/root.cjs +0 -0
- package/lib/{remix → cjs/app}/root.d.ts +1 -0
- package/lib/cjs/app/root.d.ts.map +1 -0
- package/lib/cjs/components/{body.props.json → __generated__/body.props.json} +0 -0
- package/lib/cjs/components/{bold.props.json → __generated__/bold.props.json} +0 -0
- package/lib/cjs/components/{box.props.json → __generated__/box.props.json} +0 -0
- package/lib/cjs/components/{button.props.json → __generated__/button.props.json} +0 -0
- package/lib/cjs/components/{form.props.json → __generated__/form.props.json} +0 -0
- package/lib/cjs/components/{heading.props.json → __generated__/heading.props.json} +0 -0
- package/lib/{components → cjs/components/__generated__}/image.props.json +0 -15
- package/lib/cjs/components/{input.props.json → __generated__/input.props.json} +0 -0
- package/lib/cjs/components/{italic.props.json → __generated__/italic.props.json} +0 -0
- package/lib/cjs/components/{link.props.json → __generated__/link.props.json} +0 -0
- package/lib/cjs/components/{paragraph.props.json → __generated__/paragraph.props.json} +0 -0
- package/lib/cjs/components/{span.props.json → __generated__/span.props.json} +0 -0
- package/lib/cjs/components/{subscript.props.json → __generated__/subscript.props.json} +0 -0
- package/lib/cjs/components/{superscript.props.json → __generated__/superscript.props.json} +0 -0
- package/lib/cjs/components/{text-block.props.json → __generated__/text-block.props.json} +0 -0
- package/lib/cjs/components/index.cjs +75 -31
- package/lib/cjs/components/index.d.ts +89 -15
- package/lib/cjs/components/index.d.ts.map +1 -1
- package/lib/cjs/components/index.test.cjs +3 -29
- package/lib/cjs/components/italic.ws.cjs +7 -0
- package/lib/cjs/components/italic.ws.d.ts.map +1 -1
- package/lib/cjs/components/meta.cjs +20 -18
- package/lib/cjs/components/meta.d.ts +1 -16
- package/lib/cjs/components/meta.d.ts.map +1 -1
- package/lib/cjs/css/categories.d.ts +1 -0
- package/lib/cjs/css/categories.d.ts.map +1 -1
- package/lib/cjs/css/get-browser-style.cjs +2 -1
- package/lib/cjs/css/get-browser-style.d.ts.map +1 -1
- package/lib/cjs/db/instance.d.ts +2 -2
- package/lib/cjs/db/instance.d.ts.map +1 -1
- package/lib/cjs/index.cjs +4 -3
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/tree/root.cjs +28 -0
- package/lib/cjs/tree/root.d.ts +2 -0
- package/lib/cjs/tree/root.d.ts.map +1 -1
- package/lib/cjs/tree/session-storage-polyfill.d.ts +1 -0
- package/lib/cjs/tree/session-storage-polyfill.d.ts.map +1 -1
- package/lib/cjs/tree/wrapper-component.cjs +2 -25
- package/lib/cjs/tree/wrapper-component.d.ts +1 -0
- package/lib/cjs/tree/wrapper-component.d.ts.map +1 -1
- package/lib/cjs/user-props/use-user-props-asset.cjs +22 -0
- package/lib/cjs/user-props/use-user-props-asset.d.ts +8 -0
- package/lib/cjs/user-props/use-user-props-asset.d.ts.map +1 -0
- package/lib/cjs/user-props/use-user-props.cjs +2 -12
- package/lib/cjs/user-props/use-user-props.d.ts.map +1 -1
- package/lib/components/{body.props.json → __generated__/body.props.json} +0 -0
- package/lib/components/{bold.props.json → __generated__/bold.props.json} +0 -0
- package/lib/components/{box.props.json → __generated__/box.props.json} +0 -0
- package/lib/components/{button.props.json → __generated__/button.props.json} +0 -0
- package/lib/components/{form.props.json → __generated__/form.props.json} +0 -0
- package/lib/components/{heading.props.json → __generated__/heading.props.json} +0 -0
- package/lib/{cjs/components → components/__generated__}/image.props.json +0 -15
- package/lib/components/{input.props.json → __generated__/input.props.json} +0 -0
- package/lib/components/{italic.props.json → __generated__/italic.props.json} +0 -0
- package/lib/components/{link.props.json → __generated__/link.props.json} +0 -0
- package/lib/components/{paragraph.props.json → __generated__/paragraph.props.json} +0 -0
- package/lib/components/{span.props.json → __generated__/span.props.json} +0 -0
- package/lib/components/{subscript.props.json → __generated__/subscript.props.json} +0 -0
- package/lib/components/{superscript.props.json → __generated__/superscript.props.json} +0 -0
- package/lib/components/{text-block.props.json → __generated__/text-block.props.json} +0 -0
- package/lib/components/index.d.ts +89 -15
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +70 -15
- package/lib/components/index.test.js +3 -6
- package/lib/components/italic.ws.d.ts.map +1 -1
- package/lib/components/italic.ws.js +7 -0
- package/lib/components/meta.d.ts +1 -16
- package/lib/components/meta.d.ts.map +1 -1
- package/lib/components/meta.js +18 -17
- package/lib/css/categories.d.ts +1 -0
- package/lib/css/categories.d.ts.map +1 -1
- package/lib/css/get-browser-style.d.ts.map +1 -1
- package/lib/css/get-browser-style.js +2 -1
- package/lib/db/instance.d.ts +2 -2
- package/lib/db/instance.d.ts.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/tree/root.d.ts +2 -0
- package/lib/tree/root.d.ts.map +1 -1
- package/lib/tree/root.js +5 -0
- package/lib/tree/session-storage-polyfill.d.ts +1 -0
- package/lib/tree/session-storage-polyfill.d.ts.map +1 -1
- package/lib/tree/wrapper-component.d.ts +1 -0
- package/lib/tree/wrapper-component.d.ts.map +1 -1
- package/lib/tree/wrapper-component.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user-props/use-user-props-asset.d.ts +8 -0
- package/lib/user-props/use-user-props-asset.d.ts.map +1 -0
- package/lib/user-props/use-user-props-asset.js +18 -0
- package/lib/user-props/use-user-props.d.ts.map +1 -1
- package/lib/user-props/use-user-props.js +3 -13
- package/package.json +7 -8
- package/lib/arg-types/utils.d.ts +0 -10
- package/lib/arg-types/utils.d.ts.map +0 -1
- package/lib/arg-types/utils.js +0 -83
- package/lib/cjs/arg-types/utils.cjs +0 -88
- package/lib/cjs/arg-types/utils.d.ts +0 -10
- package/lib/cjs/arg-types/utils.d.ts.map +0 -1
- package/lib/cjs/remix/handle-request.server.d.ts.map +0 -1
- package/lib/cjs/remix/index.d.ts.map +0 -1
- package/lib/cjs/remix/root.d.ts.map +0 -1
- package/lib/remix/handle-request.server.d.ts.map +0 -1
- package/lib/remix/index.d.ts.map +0 -1
- package/lib/remix/root.d.ts.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUserPropsAsset = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const all_user_props_1 = require("./all-user-props");
|
|
6
|
+
/**
|
|
7
|
+
* Get asset for prop, like src on the Image component
|
|
8
|
+
*/
|
|
9
|
+
const useUserPropsAsset = (instanceId, propName) => {
|
|
10
|
+
const [allUserProps] = (0, all_user_props_1.useAllUserProps)();
|
|
11
|
+
const propsData = allUserProps[instanceId];
|
|
12
|
+
const asset = (0, react_1.useMemo)(() => {
|
|
13
|
+
if (propsData == null)
|
|
14
|
+
return null;
|
|
15
|
+
const prop = propsData.props.find((prop) => prop.prop === propName);
|
|
16
|
+
if (prop == null)
|
|
17
|
+
return null;
|
|
18
|
+
return prop.asset ?? null;
|
|
19
|
+
}, [propName, propsData]);
|
|
20
|
+
return asset;
|
|
21
|
+
};
|
|
22
|
+
exports.useUserPropsAsset = useUserPropsAsset;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Instance } from "../db";
|
|
2
|
+
import { type UserProp } from "./schema";
|
|
3
|
+
import type { Asset } from "@webstudio-is/asset-uploader";
|
|
4
|
+
/**
|
|
5
|
+
* Get asset for prop, like src on the Image component
|
|
6
|
+
*/
|
|
7
|
+
export declare const useUserPropsAsset: (instanceId: Instance["id"], propName: UserProp["prop"]) => Asset | null;
|
|
8
|
+
//# sourceMappingURL=use-user-props-asset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-props-asset.d.ts","sourceRoot":"","sources":["../../../src/user-props/use-user-props-asset.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,iBAAiB,eAChB,QAAQ,CAAC,IAAI,CAAC,YAChB,QAAQ,CAAC,MAAM,CAAC,KACzB,KAAK,GAAG,IAaV,CAAC"}
|
|
@@ -10,24 +10,14 @@ const all_user_props_1 = require("./all-user-props");
|
|
|
10
10
|
const useUserProps = (instanceId) => {
|
|
11
11
|
const [allUserProps] = (0, all_user_props_1.useAllUserProps)();
|
|
12
12
|
const propsData = allUserProps[instanceId];
|
|
13
|
-
const
|
|
14
|
-
if (propsData
|
|
13
|
+
const props = (0, react_1.useMemo)(() => {
|
|
14
|
+
if (propsData == null)
|
|
15
15
|
return {};
|
|
16
16
|
return propsData.props.reduce((props, { prop, value }) => {
|
|
17
17
|
props[prop] = value;
|
|
18
18
|
return props;
|
|
19
19
|
}, {});
|
|
20
20
|
}, [propsData]);
|
|
21
|
-
const [props, setProps] = (0, react_1.useState)(initialUserProps);
|
|
22
|
-
(0, react_1.useEffect)(() => {
|
|
23
|
-
if (propsData == undefined)
|
|
24
|
-
return;
|
|
25
|
-
const nextProps = {};
|
|
26
|
-
for (const prop of propsData.props) {
|
|
27
|
-
nextProps[prop.prop] = prop.value;
|
|
28
|
-
}
|
|
29
|
-
setProps(nextProps);
|
|
30
|
-
}, [propsData]);
|
|
31
21
|
return props;
|
|
32
22
|
};
|
|
33
23
|
exports.useUserProps = useUserProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-user-props.d.ts","sourceRoot":"","sources":["../../../src/user-props/use-user-props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,aAAK,SAAS,GAAG;IAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,eAAgB,QAAQ,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"use-user-props.d.ts","sourceRoot":"","sources":["../../../src/user-props/use-user-props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,aAAK,SAAS,GAAG;IAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,eAAgB,QAAQ,CAAC,IAAI,CAAC,cAatD,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -556,20 +556,5 @@
|
|
|
556
556
|
"defaultValue": null,
|
|
557
557
|
"required": false,
|
|
558
558
|
"type": "text"
|
|
559
|
-
},
|
|
560
|
-
"quality": {
|
|
561
|
-
"defaultValue": null,
|
|
562
|
-
"required": false,
|
|
563
|
-
"type": "number"
|
|
564
|
-
},
|
|
565
|
-
"loader": {
|
|
566
|
-
"defaultValue": null,
|
|
567
|
-
"required": false,
|
|
568
|
-
"type": "text"
|
|
569
|
-
},
|
|
570
|
-
"optimize": {
|
|
571
|
-
"defaultValue": null,
|
|
572
|
-
"required": false,
|
|
573
|
-
"type": "boolean"
|
|
574
559
|
}
|
|
575
560
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,16 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const components: {
|
|
3
|
+
readonly Body: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "key" | keyof import("react").HTMLAttributes<HTMLBodyElement>> & import("react").RefAttributes<HTMLBodyElement>>>;
|
|
4
|
+
readonly Box: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
6
|
+
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "tag"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
7
|
+
readonly TextBlock: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
8
|
+
readonly Heading: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
9
|
+
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
10
|
+
}, "key" | "tag" | keyof import("react").HTMLAttributes<HTMLHeadingElement>> & import("react").RefAttributes<HTMLHeadingElement>>>;
|
|
11
|
+
readonly Paragraph: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "key" | keyof import("react").HTMLAttributes<HTMLParagraphElement>> & import("react").RefAttributes<HTMLParagraphElement>>>;
|
|
12
|
+
readonly Link: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href"> & {
|
|
13
|
+
href?: string | undefined;
|
|
14
|
+
}, "color" | "translate" | "type" | "id" | "children" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "href" | "download" | "hrefLang" | "ping" | "rel" | "referrerPolicy"> & import("react").RefAttributes<HTMLAnchorElement>>>;
|
|
15
|
+
readonly Span: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & import("react").RefAttributes<HTMLSpanElement>>>;
|
|
16
|
+
readonly Bold: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
17
|
+
readonly Italic: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
18
|
+
readonly Superscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
19
|
+
readonly Subscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
20
|
+
readonly Button: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
21
|
+
readonly Input: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & import("react").RefAttributes<HTMLInputElement>>>;
|
|
22
|
+
readonly Form: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "key" | keyof import("react").FormHTMLAttributes<HTMLFormElement>> & import("react").RefAttributes<HTMLFormElement>>>;
|
|
23
|
+
readonly Image: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement>> & import("react").RefAttributes<HTMLImageElement>>>;
|
|
24
|
+
};
|
|
25
|
+
declare type RegisteredComponents = Partial<{
|
|
26
|
+
[p in ComponentName]: {
|
|
27
|
+
Component: {};
|
|
28
|
+
meta?: Partial<Omit<typeof components[p], "Component">>;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export declare type ComponentName = keyof typeof components;
|
|
32
|
+
export declare const getComponentNames: () => ComponentName[];
|
|
33
|
+
export declare const getComponentMeta: <Name extends "Body" | "Box" | "TextBlock" | "Heading" | "Paragraph" | "Link" | "Span" | "Bold" | "Italic" | "Subscript" | "Button" | "Input" | "Form" | "Image" | "Superscript">(name: Name) => Omit<{
|
|
34
|
+
readonly Body: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "key" | keyof import("react").HTMLAttributes<HTMLBodyElement>> & import("react").RefAttributes<HTMLBodyElement>>>;
|
|
35
|
+
readonly Box: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
36
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
37
|
+
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "tag"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
38
|
+
readonly TextBlock: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
39
|
+
readonly Heading: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
40
|
+
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
41
|
+
}, "key" | "tag" | keyof import("react").HTMLAttributes<HTMLHeadingElement>> & import("react").RefAttributes<HTMLHeadingElement>>>;
|
|
42
|
+
readonly Paragraph: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "key" | keyof import("react").HTMLAttributes<HTMLParagraphElement>> & import("react").RefAttributes<HTMLParagraphElement>>>;
|
|
43
|
+
readonly Link: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href"> & {
|
|
44
|
+
href?: string | undefined;
|
|
45
|
+
}, "color" | "translate" | "type" | "id" | "children" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "href" | "download" | "hrefLang" | "ping" | "rel" | "referrerPolicy"> & import("react").RefAttributes<HTMLAnchorElement>>>;
|
|
46
|
+
readonly Span: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & import("react").RefAttributes<HTMLSpanElement>>>;
|
|
47
|
+
readonly Bold: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
48
|
+
readonly Italic: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
49
|
+
readonly Superscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
50
|
+
readonly Subscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
51
|
+
readonly Button: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
52
|
+
readonly Input: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & import("react").RefAttributes<HTMLInputElement>>>;
|
|
53
|
+
readonly Form: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "key" | keyof import("react").FormHTMLAttributes<HTMLFormElement>> & import("react").RefAttributes<HTMLFormElement>>>;
|
|
54
|
+
readonly Image: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement>> & import("react").RefAttributes<HTMLImageElement>>>;
|
|
55
|
+
}[Name], "Component">;
|
|
56
|
+
/**
|
|
57
|
+
* @todo Remove Component from meta and read directly (via import),
|
|
58
|
+
* as meta information is not needed during production render.
|
|
59
|
+
**/
|
|
60
|
+
export declare const getComponent: <Name extends "Body" | "Box" | "TextBlock" | "Heading" | "Paragraph" | "Link" | "Span" | "Bold" | "Italic" | "Subscript" | "Button" | "Input" | "Form" | "Image" | "Superscript">(name: Name) => {
|
|
61
|
+
readonly Body: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "key" | keyof import("react").HTMLAttributes<HTMLBodyElement>> & import("react").RefAttributes<HTMLBodyElement>>>;
|
|
62
|
+
readonly Box: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
63
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
64
|
+
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "tag"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
65
|
+
readonly TextBlock: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
66
|
+
readonly Heading: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
67
|
+
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
68
|
+
}, "key" | "tag" | keyof import("react").HTMLAttributes<HTMLHeadingElement>> & import("react").RefAttributes<HTMLHeadingElement>>>;
|
|
69
|
+
readonly Paragraph: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "key" | keyof import("react").HTMLAttributes<HTMLParagraphElement>> & import("react").RefAttributes<HTMLParagraphElement>>>;
|
|
70
|
+
readonly Link: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href"> & {
|
|
71
|
+
href?: string | undefined;
|
|
72
|
+
}, "color" | "translate" | "type" | "id" | "children" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "href" | "download" | "hrefLang" | "ping" | "rel" | "referrerPolicy"> & import("react").RefAttributes<HTMLAnchorElement>>>;
|
|
73
|
+
readonly Span: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & import("react").RefAttributes<HTMLSpanElement>>>;
|
|
74
|
+
readonly Bold: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
75
|
+
readonly Italic: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
76
|
+
readonly Superscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
77
|
+
readonly Subscript: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & import("react").RefAttributes<HTMLElement>>>;
|
|
78
|
+
readonly Button: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
79
|
+
readonly Input: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & import("react").RefAttributes<HTMLInputElement>>>;
|
|
80
|
+
readonly Form: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "key" | keyof import("react").FormHTMLAttributes<HTMLFormElement>> & import("react").RefAttributes<HTMLFormElement>>>;
|
|
81
|
+
readonly Image: import("./component-type").WsComponentMeta<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement>> & import("react").RefAttributes<HTMLImageElement>>>;
|
|
82
|
+
}[Name]["Component"];
|
|
83
|
+
/**
|
|
84
|
+
* @todo: Allow register any component.
|
|
85
|
+
* Now we can register only existings Components, as all our type system would
|
|
86
|
+
* break otherwise, see getComponent etc. So its overwriteComponent now
|
|
87
|
+
**/
|
|
88
|
+
export declare const registerComponents: (components: RegisteredComponents) => void;
|
|
89
|
+
export {};
|
|
16
90
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";AAgBA,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;CAgBN,CAAC;AAEX,aAAK,oBAAoB,GAAG,OAAO,CAAC;KACjC,CAAC,IAAI,aAAa,GAAG;QAGpB,SAAS,EAAE,EAAE,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;KACzD;CACF,CAAC,CAAC;AAIH,oBAAY,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAIpD,eAAO,MAAM,iBAAiB,QAAO,aAAa,EAOjD,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;qBAc5B,CAAC;AAEF;;;IAGI;AACJ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;oBAQxB,CAAC;AAEF;;;;IAII;AACJ,eAAO,MAAM,kBAAkB,eAAgB,oBAAoB,SAElE,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -1,15 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import Body from "./body.ws";
|
|
2
|
+
import Box from "./box.ws";
|
|
3
|
+
import TextBlock from "./text-block.ws";
|
|
4
|
+
import Heading from "./heading.ws";
|
|
5
|
+
import Paragraph from "./paragraph.ws";
|
|
6
|
+
import Link from "./link.ws";
|
|
7
|
+
import Span from "./span.ws";
|
|
8
|
+
import Bold from "./bold.ws";
|
|
9
|
+
import Italic from "./italic.ws";
|
|
10
|
+
import Superscript from "./superscript.ws";
|
|
11
|
+
import Subscript from "./subscript.ws";
|
|
12
|
+
import Button from "./button.ws";
|
|
13
|
+
import Input from "./input.ws";
|
|
14
|
+
import Form from "./form.ws";
|
|
15
|
+
import Image from "./image.ws";
|
|
16
|
+
const components = {
|
|
17
|
+
Body,
|
|
18
|
+
Box,
|
|
19
|
+
TextBlock,
|
|
20
|
+
Heading,
|
|
21
|
+
Paragraph,
|
|
22
|
+
Link,
|
|
23
|
+
Span,
|
|
24
|
+
Bold,
|
|
25
|
+
Italic,
|
|
26
|
+
Superscript,
|
|
27
|
+
Subscript,
|
|
28
|
+
Button,
|
|
29
|
+
Input,
|
|
30
|
+
Form,
|
|
31
|
+
Image,
|
|
32
|
+
};
|
|
33
|
+
let registeredComponents = null;
|
|
34
|
+
const componentNames = Object.keys(components);
|
|
35
|
+
export const getComponentNames = () => {
|
|
36
|
+
const uniqueNames = new Set([
|
|
37
|
+
...componentNames,
|
|
38
|
+
...Object.keys(registeredComponents || {}),
|
|
39
|
+
]);
|
|
40
|
+
return [...uniqueNames.values()];
|
|
41
|
+
};
|
|
42
|
+
export const getComponentMeta = (name) => {
|
|
43
|
+
if (registeredComponents != null &&
|
|
44
|
+
name in registeredComponents &&
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
+
registeredComponents[name].meta != null) {
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
|
+
return { ...components[name], ...registeredComponents[name].meta };
|
|
49
|
+
}
|
|
50
|
+
return components[name];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @todo Remove Component from meta and read directly (via import),
|
|
54
|
+
* as meta information is not needed during production render.
|
|
55
|
+
**/
|
|
56
|
+
export const getComponent = (name) => {
|
|
57
|
+
return registeredComponents != null && name in registeredComponents
|
|
58
|
+
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
59
|
+
registeredComponents[name]
|
|
60
|
+
.Component
|
|
61
|
+
: components[name].Component;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @todo: Allow register any component.
|
|
65
|
+
* Now we can register only existings Components, as all our type system would
|
|
66
|
+
* break otherwise, see getComponent etc. So its overwriteComponent now
|
|
67
|
+
**/
|
|
68
|
+
export const registerComponents = (components) => {
|
|
69
|
+
registeredComponents = components;
|
|
70
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getComponentNames, getComponentMeta } from "./index";
|
|
2
2
|
import { WsComponentMeta } from "./component-type";
|
|
3
|
-
test.each(
|
|
4
|
-
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
WsComponentMeta.parse(component);
|
|
3
|
+
test.each(getComponentNames())("validating meta definition of %s", (name) => {
|
|
4
|
+
WsComponentMeta.parse(getComponentMeta(name));
|
|
8
5
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"italic.ws.d.ts","sourceRoot":"","sources":["../../src/components/italic.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"italic.ws.d.ts","sourceRoot":"","sources":["../../src/components/italic.ws.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,OAAO,MAAM,CASxC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { FontItalicIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { Italic } from "./italic";
|
|
3
|
+
const defaultStyle = {
|
|
4
|
+
fontStyle: {
|
|
5
|
+
type: "keyword",
|
|
6
|
+
value: "italic",
|
|
7
|
+
},
|
|
8
|
+
};
|
|
3
9
|
const meta = {
|
|
4
10
|
Icon: FontItalicIcon,
|
|
5
11
|
Component: Italic,
|
|
12
|
+
defaultStyle,
|
|
6
13
|
canAcceptChildren: false,
|
|
7
14
|
isContentEditable: false,
|
|
8
15
|
isInlineOnly: true,
|
package/lib/components/meta.d.ts
CHANGED
|
@@ -7442,21 +7442,6 @@ declare const meta: {
|
|
|
7442
7442
|
required: boolean;
|
|
7443
7443
|
type: string;
|
|
7444
7444
|
};
|
|
7445
|
-
quality: {
|
|
7446
|
-
defaultValue: null;
|
|
7447
|
-
required: boolean;
|
|
7448
|
-
type: string;
|
|
7449
|
-
};
|
|
7450
|
-
loader: {
|
|
7451
|
-
defaultValue: null;
|
|
7452
|
-
required: boolean;
|
|
7453
|
-
type: string;
|
|
7454
|
-
};
|
|
7455
|
-
optimize: {
|
|
7456
|
-
defaultValue: null;
|
|
7457
|
-
required: boolean;
|
|
7458
|
-
type: string;
|
|
7459
|
-
};
|
|
7460
7445
|
};
|
|
7461
7446
|
};
|
|
7462
7447
|
declare type MetaProp = {
|
|
@@ -7474,6 +7459,6 @@ declare type MetaProp = {
|
|
|
7474
7459
|
options: string[];
|
|
7475
7460
|
};
|
|
7476
7461
|
declare type MetaProps = Record<string, MetaProp>;
|
|
7477
|
-
export declare const
|
|
7462
|
+
export declare const getComponentMetaProps: (name: keyof typeof meta) => MetaProps;
|
|
7478
7463
|
export {};
|
|
7479
7464
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/components/meta.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/components/meta.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
package/lib/components/meta.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import Body from "./body.props.json";
|
|
2
|
-
import Button from "./button.props.json";
|
|
3
|
-
import Bold from "./bold.props.json";
|
|
4
|
-
import Box from "./box.props.json";
|
|
5
|
-
import Form from "./form.props.json";
|
|
6
|
-
import Heading from "./heading.props.json";
|
|
7
|
-
import Input from "./input.props.json";
|
|
8
|
-
import Italic from "./italic.props.json";
|
|
9
|
-
import Superscript from "./superscript.props.json";
|
|
10
|
-
import Subscript from "./subscript.props.json";
|
|
11
|
-
import Link from "./link.props.json";
|
|
12
|
-
import Paragraph from "./paragraph.props.json";
|
|
13
|
-
import Span from "./span.props.json";
|
|
14
|
-
import TextBlock from "./text-block.props.json";
|
|
15
|
-
import Image from "./image.props.json";
|
|
1
|
+
import Body from "./__generated__/body.props.json";
|
|
2
|
+
import Button from "./__generated__/button.props.json";
|
|
3
|
+
import Bold from "./__generated__/bold.props.json";
|
|
4
|
+
import Box from "./__generated__/box.props.json";
|
|
5
|
+
import Form from "./__generated__/form.props.json";
|
|
6
|
+
import Heading from "./__generated__/heading.props.json";
|
|
7
|
+
import Input from "./__generated__/input.props.json";
|
|
8
|
+
import Italic from "./__generated__/italic.props.json";
|
|
9
|
+
import Superscript from "./__generated__/superscript.props.json";
|
|
10
|
+
import Subscript from "./__generated__/subscript.props.json";
|
|
11
|
+
import Link from "./__generated__/link.props.json";
|
|
12
|
+
import Paragraph from "./__generated__/paragraph.props.json";
|
|
13
|
+
import Span from "./__generated__/span.props.json";
|
|
14
|
+
import TextBlock from "./__generated__/text-block.props.json";
|
|
15
|
+
import Image from "./__generated__/image.props.json";
|
|
16
16
|
const meta = {
|
|
17
17
|
Body,
|
|
18
18
|
Button,
|
|
@@ -30,5 +30,6 @@ const meta = {
|
|
|
30
30
|
TextBlock,
|
|
31
31
|
Image,
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export const getComponentMetaProps = (name) => {
|
|
34
|
+
return meta[name];
|
|
35
|
+
};
|
package/lib/css/categories.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export declare const categories: {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
export declare const propertyCategoryMap: {
|
|
59
|
+
[x: `--${string}`]: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
59
60
|
accentColor: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
60
61
|
alignContent: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
61
62
|
alignItems: "position" | "layout" | "flexChild" | "gridChild" | "spacing" | "size" | "typography" | "backgrounds" | "borders" | "effects" | "other";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/css/categories.ts"],"names":[],"mappings":"AA0MA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/css/categories.ts"],"names":[],"mappings":"AA0MA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE/B,CAAC;AAUF,oBAAY,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-browser-style.d.ts","sourceRoot":"","sources":["../../src/css/get-browser-style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"get-browser-style.d.ts","sourceRoot":"","sources":["../../src/css/get-browser-style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAoB,MAAM,wBAAwB,CAAC;AAgCtE,eAAO,MAAM,eAAe,aAAc,OAAO,KAAG,KAiBnD,CAAC"}
|
package/lib/db/instance.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CssRule } from "@webstudio-is/css-data";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import
|
|
3
|
+
import { ComponentName } from "../components";
|
|
4
4
|
export declare type BaseInstance = {
|
|
5
5
|
id: string;
|
|
6
|
-
component:
|
|
6
|
+
component: ComponentName;
|
|
7
7
|
cssRules: Array<CssRule>;
|
|
8
8
|
};
|
|
9
9
|
export declare type Instance = BaseInstance & {
|