@wix/public-editor-platform-interfaces 1.26.0 → 1.27.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/dist/generated/dm-types.d.ts +1124 -0
- package/dist/generated/dm-types.js +265 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -1
- package/dist/sdk/css-properties.d.ts +176 -0
- package/dist/sdk/css-properties.js +158 -0
- package/dist/sdk/data.d.ts +95 -0
- package/dist/sdk/data.js +6 -0
- package/dist/sdk/definitions.d.ts +52 -0
- package/dist/sdk/definitions.js +9 -0
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +20 -0
- package/dist/sdk/styles.d.ts +19 -0
- package/dist/sdk/styles.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type * as DmTypes from '../generated/dm-types';
|
|
2
|
+
import { DataType } from '../generated/dm-types';
|
|
3
|
+
export { DataType } from '../generated/dm-types';
|
|
4
|
+
/**
|
|
5
|
+
* Viewer-derived fields added by the SDK to all link types.
|
|
6
|
+
* - `displayName`: human-readable label resolved by editor
|
|
7
|
+
* - `href`: resolved URL (viewer concern, not stored in DM)
|
|
8
|
+
* - `rel`: normalized to space-separated string (DM stores as enum array)
|
|
9
|
+
*/
|
|
10
|
+
type ElementLinkExtension = {
|
|
11
|
+
displayName: string;
|
|
12
|
+
href?: string;
|
|
13
|
+
rel?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ElementPageLink = DmTypes.PageLink & ElementLinkExtension & {
|
|
16
|
+
type: 'PageLink';
|
|
17
|
+
};
|
|
18
|
+
export type ElementExternalLink = DmTypes.ExternalLink & ElementLinkExtension & {
|
|
19
|
+
type: 'ExternalLink';
|
|
20
|
+
};
|
|
21
|
+
export type ElementEmailLink = DmTypes.EmailLink & ElementLinkExtension & {
|
|
22
|
+
type: 'EmailLink';
|
|
23
|
+
};
|
|
24
|
+
export type ElementPhoneLink = DmTypes.PhoneLink & ElementLinkExtension & {
|
|
25
|
+
type: 'PhoneLink';
|
|
26
|
+
};
|
|
27
|
+
export type ElementWhatsAppLink = DmTypes.WhatsAppLink & ElementLinkExtension & {
|
|
28
|
+
type: 'WhatsAppLink';
|
|
29
|
+
};
|
|
30
|
+
export type ElementAddressLink = DmTypes.AddressLink & ElementLinkExtension & {
|
|
31
|
+
type: 'AddressLink';
|
|
32
|
+
};
|
|
33
|
+
export type ElementAnchorLink = DmTypes.AnchorLink & ElementLinkExtension & {
|
|
34
|
+
type: 'AnchorLink';
|
|
35
|
+
};
|
|
36
|
+
export type ElementDocumentLink = DmTypes.DocumentLink & ElementLinkExtension & {
|
|
37
|
+
type: 'DocumentLink';
|
|
38
|
+
};
|
|
39
|
+
export type ElementDynamicPageLink = DmTypes.DynamicPageLink & ElementLinkExtension & {
|
|
40
|
+
type: 'DynamicPageLink';
|
|
41
|
+
};
|
|
42
|
+
export type ElementTpaPageLink = DmTypes.TpaPageLink & ElementLinkExtension & {
|
|
43
|
+
type: 'TpaPageLink';
|
|
44
|
+
};
|
|
45
|
+
export type ElementLoginToWixLink = DmTypes.LoginToWixLink & ElementLinkExtension & {
|
|
46
|
+
type: 'LoginToWixLink';
|
|
47
|
+
};
|
|
48
|
+
export type ElementTextLink = DmTypes.TextLink & ElementLinkExtension & {
|
|
49
|
+
type: 'TextLink';
|
|
50
|
+
};
|
|
51
|
+
export type ElementLink = ElementPageLink | ElementExternalLink | ElementEmailLink | ElementPhoneLink | ElementWhatsAppLink | ElementAddressLink | ElementAnchorLink | ElementDocumentLink | ElementDynamicPageLink | ElementTpaPageLink | ElementLoginToWixLink | ElementTextLink;
|
|
52
|
+
export type ElementImage = DmTypes.Image;
|
|
53
|
+
export type ElementVideo = DmTypes.Video;
|
|
54
|
+
export type ElementAudio = DmTypes.Audio;
|
|
55
|
+
export type ElementVectorArt = DmTypes.VectorArt;
|
|
56
|
+
export type ElementMenuItems = DmTypes.MenuItems;
|
|
57
|
+
export type ElementA11y = DmTypes.A11y;
|
|
58
|
+
export type ElementRichText = DmTypes.RichText;
|
|
59
|
+
export type ElementDirection = DmTypes.Direction;
|
|
60
|
+
export type ElementDataValue = string | number | boolean | ElementLink | ElementImage | ElementVideo | ElementAudio | ElementVectorArt | ElementMenuItems | ElementA11y | ElementRichText | ElementDirection | ElementDataObject | ElementDataValue[] | null | undefined;
|
|
61
|
+
export type ElementDataObject = {
|
|
62
|
+
[key: string]: ElementDataValue;
|
|
63
|
+
};
|
|
64
|
+
export type ElementData = ElementDataObject;
|
|
65
|
+
export type ElementDataInput = Partial<ElementData>;
|
|
66
|
+
export type ElementDataTypeMap = {
|
|
67
|
+
[DataType.TEXT]: string;
|
|
68
|
+
[DataType.TEXT_ENUM]: string;
|
|
69
|
+
[DataType.NUMBER]: number;
|
|
70
|
+
[DataType.BOOLEAN_VALUE]: boolean;
|
|
71
|
+
[DataType.A11Y]: ElementA11y;
|
|
72
|
+
[DataType.LINK]: ElementLink;
|
|
73
|
+
[DataType.IMAGE]: ElementImage;
|
|
74
|
+
[DataType.VIDEO]: ElementVideo;
|
|
75
|
+
[DataType.VECTOR_ART]: ElementVectorArt;
|
|
76
|
+
[DataType.AUDIO]: ElementAudio;
|
|
77
|
+
[DataType.LOCAL_DATE]: string;
|
|
78
|
+
[DataType.LOCAL_TIME]: string;
|
|
79
|
+
[DataType.LOCAL_DATE_TIME]: string;
|
|
80
|
+
[DataType.WEB_URL]: string;
|
|
81
|
+
[DataType.EMAIL]: string;
|
|
82
|
+
[DataType.PHONE]: string;
|
|
83
|
+
[DataType.HOSTNAME]: string;
|
|
84
|
+
[DataType.REGEX]: string;
|
|
85
|
+
[DataType.GUID]: string;
|
|
86
|
+
[DataType.RICH_TEXT]: ElementRichText;
|
|
87
|
+
[DataType.CONTAINER]: ElementDataObject | string;
|
|
88
|
+
[DataType.ARRAY_ITEMS]: ElementDataValue[];
|
|
89
|
+
[DataType.DIRECTION]: ElementDirection;
|
|
90
|
+
[DataType.MENU_ITEMS]: ElementMenuItems;
|
|
91
|
+
[DataType.DATA]: ElementDataObject;
|
|
92
|
+
[DataType.SCHEMA]: ElementDataValue;
|
|
93
|
+
[DataType.UNKNOWN_DATA_TYPE]: ElementDataValue;
|
|
94
|
+
};
|
|
95
|
+
export type ElementDefaultValueFor<TypeKey extends keyof ElementDataTypeMap> = ElementDataTypeMap[TypeKey];
|
package/dist/sdk/data.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataType = void 0;
|
|
4
|
+
const dm_types_1 = require("../generated/dm-types");
|
|
5
|
+
var dm_types_2 = require("../generated/dm-types");
|
|
6
|
+
Object.defineProperty(exports, "DataType", { enumerable: true, get: function () { return dm_types_2.DataType; } });
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified types for definition getters.
|
|
3
|
+
* These expose only the commonly-used fields from the internal manifest types.
|
|
4
|
+
*/
|
|
5
|
+
import type { DataType } from '../generated/dm-types';
|
|
6
|
+
import type { ElementDataTypeMap, ElementDataValue } from './data';
|
|
7
|
+
import type { CssPropertyType, CssPropertyOptions } from './css-properties';
|
|
8
|
+
import type { ElementStyleValue, CssPropertyKey } from './styles';
|
|
9
|
+
export { DataType } from '../generated/dm-types';
|
|
10
|
+
export type ElementStyleDefinition = {
|
|
11
|
+
displayName?: string | null;
|
|
12
|
+
defaultValue?: ElementStyleValue;
|
|
13
|
+
statesDefaultValues?: Record<string, ElementStyleValue>;
|
|
14
|
+
/** Only for cssCustomProperties */
|
|
15
|
+
cssPropertyType?: CssPropertyType;
|
|
16
|
+
/** Configuration options for specific CSS property types (filter, display, etc.) */
|
|
17
|
+
cssPropertyOptions?: CssPropertyOptions;
|
|
18
|
+
};
|
|
19
|
+
export type ElementStyleDefinitions = {
|
|
20
|
+
cssProperties: Partial<Record<CssPropertyKey, ElementStyleDefinition>>;
|
|
21
|
+
cssCustomProperties: Record<string, ElementStyleDefinition>;
|
|
22
|
+
};
|
|
23
|
+
export type ElementStyleDefaultValues = {
|
|
24
|
+
cssProperties: Partial<Record<CssPropertyKey, ElementStyleValue>>;
|
|
25
|
+
cssCustomProperties: Record<string, ElementStyleValue>;
|
|
26
|
+
};
|
|
27
|
+
export type ElementPresetDefinition = {
|
|
28
|
+
displayName?: string;
|
|
29
|
+
thumbnailUrl?: string | null;
|
|
30
|
+
initialSize?: {
|
|
31
|
+
width?: number | null;
|
|
32
|
+
height?: number | null;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type ElementPresetDefinitions = Record<string, ElementPresetDefinition>;
|
|
36
|
+
export type NativeStateType = 'hover' | 'focus' | 'disabled' | 'invalid';
|
|
37
|
+
export type ElementStateDefinition = {
|
|
38
|
+
displayName?: string | null;
|
|
39
|
+
className?: string | null;
|
|
40
|
+
pseudoClass?: NativeStateType;
|
|
41
|
+
props?: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
export type ElementStateDefinitions = Record<string, ElementStateDefinition>;
|
|
44
|
+
export type ElementDataDefinition<TypeKey extends DataType = DataType> = {
|
|
45
|
+
dataType?: TypeKey;
|
|
46
|
+
displayName?: string | null;
|
|
47
|
+
defaultValue?: TypeKey extends keyof ElementDataTypeMap ? ElementDataTypeMap[TypeKey] : ElementDataValue;
|
|
48
|
+
};
|
|
49
|
+
export type ElementDataDefinitions = Record<string, ElementDataDefinition>;
|
|
50
|
+
export type ElementDataDefaultValues = Partial<{
|
|
51
|
+
[Key in DataType]: ElementDataTypeMap[Key];
|
|
52
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Simplified types for definition getters.
|
|
4
|
+
* These expose only the commonly-used fields from the internal manifest types.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DataType = void 0;
|
|
8
|
+
var dm_types_1 = require("../generated/dm-types");
|
|
9
|
+
Object.defineProperty(exports, "DataType", { enumerable: true, get: function () { return dm_types_1.DataType; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./data"), exports);
|
|
18
|
+
__exportStar(require("./styles"), exports);
|
|
19
|
+
__exportStar(require("./definitions"), exports);
|
|
20
|
+
__exportStar(require("./css-properties"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CssPropertyType } from './css-properties';
|
|
2
|
+
export type ElementStyleValue = string;
|
|
3
|
+
/**
|
|
4
|
+
* Union type that extracts string literal values from CssPropertyType enum.
|
|
5
|
+
* This provides backward compatibility - accepts both enum values and string literals.
|
|
6
|
+
*/
|
|
7
|
+
export type CssPropertyKey = `${CssPropertyType}`;
|
|
8
|
+
export type ElementStyles = {
|
|
9
|
+
cssProperties: Partial<Record<CssPropertyKey, ElementStyleValue>>;
|
|
10
|
+
cssCustomProperties: Record<string, ElementStyleValue>;
|
|
11
|
+
};
|
|
12
|
+
export type ElementStylesUpdate = {
|
|
13
|
+
cssProperties?: Partial<Record<CssPropertyKey, ElementStyleValue>>;
|
|
14
|
+
cssCustomProperties?: Record<string, ElementStyleValue>;
|
|
15
|
+
};
|
|
16
|
+
export type ElementStylesRemoval = {
|
|
17
|
+
cssPropertiesKeys?: CssPropertyKey[];
|
|
18
|
+
cssCustomPropertiesKeys?: string[];
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/public-editor-platform-interfaces",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
"falconPackageHash": "
|
|
54
|
+
"falconPackageHash": "ac7a6d50948d2e5bc9a401415282ab3c4facd215884cbd1d835f6297"
|
|
55
55
|
}
|