@widgetic/editor 4.1.19 → 4.1.20

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.
@@ -0,0 +1,409 @@
1
+ {
2
+ "id": "embedding-options-schema-001",
3
+ "name": "Embedding Options Schema",
4
+ "version": "1.0.0",
5
+ "componentGroups": [
6
+ {
7
+ "name": "Embed Composition",
8
+ "components": [
9
+ {
10
+ "id": "embed-options",
11
+ "type": "embedOptions",
12
+ "propertyGroups": [
13
+ {
14
+ "name": "Basic options",
15
+ "properties": [
16
+ {
17
+ "name": "useIframe",
18
+ "type": "boolean",
19
+ "defaultValue": false,
20
+ "inputController": {
21
+ "type": "switch",
22
+ "helpText": "Embed as an isolated <iframe>. Simplest and safest, but the widget cannot autoscale or listen to page events. Turn this off to use the Widgetic SDK snippet.",
23
+ "description": "Use iframe"
24
+ }
25
+ },
26
+ {
27
+ "name": "resizeMode",
28
+ "type": "string",
29
+ "defaultValue": "fillWidth",
30
+ "inputController": {
31
+ "type": "dropdown",
32
+ "helpText": "Choose how the widget should be resized",
33
+ "description": "Resize mode",
34
+ "options": [
35
+ {
36
+ "label": "Fill width",
37
+ "value": "fillWidth"
38
+ },
39
+ {
40
+ "label": "Fixed",
41
+ "value": "fixed"
42
+ },
43
+ {
44
+ "label": "Responsive",
45
+ "value": "responsive"
46
+ },
47
+ {
48
+ "label": "Custom",
49
+ "value": "custom"
50
+ }
51
+ ]
52
+ },
53
+ "visibilityCondition": {
54
+ "dependsOn": "useIframe",
55
+ "condition": "useIframe === false"
56
+ }
57
+ },
58
+ {
59
+ "name": "width",
60
+ "type": "number",
61
+ "defaultValue": 405,
62
+ "inputController": {
63
+ "type": "number",
64
+ "helpText": "Set the width of the widget in pixels",
65
+ "description": "Width",
66
+ "config": {
67
+ "min": 50,
68
+ "max": 4096,
69
+ "step": 1
70
+ }
71
+ },
72
+ "visibilityCondition": {
73
+ "dependsOn": [
74
+ "useIframe",
75
+ "resizeMode"
76
+ ],
77
+ "condition": "useIframe === true || resizeMode === 'custom' || resizeMode === 'fixed'"
78
+ }
79
+ },
80
+ {
81
+ "name": "height",
82
+ "type": "number",
83
+ "defaultValue": 300,
84
+ "inputController": {
85
+ "type": "number",
86
+ "helpText": "Set the height of the widget in pixels",
87
+ "description": "Height",
88
+ "config": {
89
+ "min": 50,
90
+ "max": 4096,
91
+ "step": 1
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "name": "responsive",
97
+ "type": "number",
98
+ "defaultValue": 480,
99
+ "inputController": {
100
+ "type": "number",
101
+ "helpText": "Below this viewport width the widget switches to the adaptive layout",
102
+ "description": "Adaptive width",
103
+ "config": {
104
+ "min": 0,
105
+ "max": 4096,
106
+ "step": 1
107
+ }
108
+ },
109
+ "visibilityCondition": {
110
+ "dependsOn": [
111
+ "useIframe",
112
+ "resizeMode"
113
+ ],
114
+ "condition": "useIframe === false && resizeMode === 'responsive'"
115
+ }
116
+ },
117
+ {
118
+ "name": "autoscale",
119
+ "type": "boolean",
120
+ "defaultValue": true,
121
+ "inputController": {
122
+ "type": "switch",
123
+ "helpText": "Let the widget report its real height to the page so its container never clips or scrolls",
124
+ "description": "Autoscale"
125
+ },
126
+ "visibilityCondition": {
127
+ "dependsOn": "useIframe",
128
+ "condition": "useIframe === false"
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "name": "Advanced settings",
135
+ "properties": [
136
+ {
137
+ "name": "embedTarget",
138
+ "type": "string",
139
+ "defaultValue": "overlay",
140
+ "inputController": {
141
+ "type": "dropdown",
142
+ "helpText": "Choose the embed target",
143
+ "description": "Embed target",
144
+ "options": [
145
+ {
146
+ "label": "Inline",
147
+ "value": "site"
148
+ },
149
+ {
150
+ "label": "Overlay",
151
+ "value": "overlay"
152
+ },
153
+ {
154
+ "label": "Mixed",
155
+ "value": "mixed"
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ {
161
+ "name": "overlayPosition",
162
+ "type": "string",
163
+ "defaultValue": "center-center",
164
+ "inputController": {
165
+ "type": "fixedposition",
166
+ "helpText": "Set the overlay position",
167
+ "description": "Overlay position"
168
+ },
169
+ "visibilityCondition": {
170
+ "dependsOn": "embedTarget",
171
+ "condition": "embedTarget === 'overlay' || embedTarget === 'mixed'"
172
+ }
173
+ },
174
+ {
175
+ "name": "eventTriggers",
176
+ "type": "string",
177
+ "defaultValue": "exitIntent",
178
+ "inputController": {
179
+ "type": "dropdown",
180
+ "helpText": "Choose the event trigger",
181
+ "description": "Event triggers",
182
+ "options": [
183
+ {
184
+ "label": "Exit intent",
185
+ "value": "exitIntent"
186
+ },
187
+ {
188
+ "label": "Page load",
189
+ "value": "pageLoad"
190
+ }
191
+ ]
192
+ },
193
+ "visibilityCondition": {
194
+ "dependsOn": "embedTarget",
195
+ "condition": "embedTarget === 'overlay'"
196
+ }
197
+ },
198
+ {
199
+ "name": "restrictions",
200
+ "type": "boolean",
201
+ "defaultValue": false,
202
+ "inputController": {
203
+ "type": "switch",
204
+ "helpText": "Enable restrictions",
205
+ "description": "Restrictions"
206
+ }
207
+ },
208
+ {
209
+ "name": "maxViews",
210
+ "type": "number",
211
+ "defaultValue": 10,
212
+ "inputController": {
213
+ "type": "number",
214
+ "helpText": "Set the maximum number of views",
215
+ "description": "Max # of views",
216
+ "config": {
217
+ "min": 1,
218
+ "max": 100000,
219
+ "step": 1
220
+ }
221
+ },
222
+ "visibilityCondition": {
223
+ "dependsOn": "restrictions",
224
+ "condition": "restrictions === true"
225
+ }
226
+ },
227
+ {
228
+ "name": "timePeriod",
229
+ "type": "number",
230
+ "defaultValue": 120,
231
+ "inputController": {
232
+ "type": "number",
233
+ "helpText": "Set the time period in hours",
234
+ "description": "Time period",
235
+ "config": {
236
+ "min": 1,
237
+ "max": 8760,
238
+ "step": 1
239
+ }
240
+ },
241
+ "visibilityCondition": {
242
+ "dependsOn": "restrictions",
243
+ "condition": "restrictions === true"
244
+ }
245
+ },
246
+ {
247
+ "name": "displayOnMobile",
248
+ "type": "boolean",
249
+ "defaultValue": true,
250
+ "inputController": {
251
+ "type": "switch",
252
+ "helpText": "Display on mobile devices",
253
+ "description": "Display on mobile"
254
+ },
255
+ "visibilityCondition": {
256
+ "dependsOn": "restrictions",
257
+ "condition": "restrictions === true"
258
+ }
259
+ },
260
+ {
261
+ "name": "displayOnDesktop",
262
+ "type": "boolean",
263
+ "defaultValue": true,
264
+ "inputController": {
265
+ "type": "switch",
266
+ "helpText": "Display on desktop devices",
267
+ "description": "Display on desktop"
268
+ },
269
+ "visibilityCondition": {
270
+ "dependsOn": "restrictions",
271
+ "condition": "restrictions === true"
272
+ }
273
+ },
274
+ {
275
+ "name": "keepDimensions",
276
+ "type": "boolean",
277
+ "defaultValue": true,
278
+ "inputController": {
279
+ "type": "switch",
280
+ "helpText": "Keep width, height, resize the same",
281
+ "description": "Keep dimensions"
282
+ },
283
+ "visibilityCondition": {
284
+ "dependsOn": "embedTarget",
285
+ "condition": "embedTarget === 'mixed'"
286
+ }
287
+ },
288
+ {
289
+ "name": "overlayResizeMode",
290
+ "type": "string",
291
+ "defaultValue": "fillWidth",
292
+ "inputController": {
293
+ "type": "dropdown",
294
+ "helpText": "Choose how the overlay widget should be resized",
295
+ "description": "Overlay resize mode",
296
+ "options": [
297
+ {
298
+ "label": "Fill width",
299
+ "value": "fillWidth"
300
+ },
301
+ {
302
+ "label": "Fill height",
303
+ "value": "fillHeight"
304
+ },
305
+ {
306
+ "label": "Fixed size",
307
+ "value": "fixedSize"
308
+ },
309
+ {
310
+ "label": "Fixed height",
311
+ "value": "fixedHeight"
312
+ },
313
+ {
314
+ "label": "Fixed width",
315
+ "value": "fixedWidth"
316
+ },
317
+ {
318
+ "label": "Allow scale down",
319
+ "value": "allowScaleDown"
320
+ },
321
+ {
322
+ "label": "Fill",
323
+ "value": "fill"
324
+ }
325
+ ]
326
+ },
327
+ "visibilityCondition": {
328
+ "dependsOn": ["embedTarget", "keepDimensions"],
329
+ "condition": "embedTarget === 'mixed' && keepDimensions === false"
330
+ }
331
+ },
332
+ {
333
+ "name": "overlayWidth",
334
+ "type": "number",
335
+ "defaultValue": 405,
336
+ "inputController": {
337
+ "type": "number",
338
+ "helpText": "Set the width of the overlay widget in pixels",
339
+ "description": "Overlay width",
340
+ "config": {
341
+ "min": 50,
342
+ "max": 4096,
343
+ "step": 1
344
+ }
345
+ },
346
+ "visibilityCondition": {
347
+ "dependsOn": ["embedTarget", "keepDimensions", "overlayResizeMode"],
348
+ "condition": "embedTarget === 'mixed' && keepDimensions === false && (overlayResizeMode === 'fixedSize' || overlayResizeMode === 'fixedWidth' || overlayResizeMode === 'allowScaleDown')"
349
+ }
350
+ },
351
+ {
352
+ "name": "overlayHeight",
353
+ "type": "number",
354
+ "defaultValue": 300,
355
+ "inputController": {
356
+ "type": "number",
357
+ "helpText": "Set the height of the overlay widget in pixels",
358
+ "description": "Overlay height",
359
+ "config": {
360
+ "min": 50,
361
+ "max": 4096,
362
+ "step": 1
363
+ }
364
+ },
365
+ "visibilityCondition": {
366
+ "dependsOn": ["embedTarget", "keepDimensions", "overlayResizeMode"],
367
+ "condition": "embedTarget === 'mixed' && keepDimensions === false && (overlayResizeMode === 'fixedSize' || overlayResizeMode === 'fixedHeight' || overlayResizeMode === 'allowScaleDown')"
368
+ }
369
+ },
370
+ {
371
+ "name": "addBackgroundColor",
372
+ "type": "boolean",
373
+ "defaultValue": false,
374
+ "inputController": {
375
+ "type": "switch",
376
+ "helpText": "Add a background color to the overlay. It will prevent click-through.",
377
+ "description": "Add background"
378
+ },
379
+ "visibilityCondition": {
380
+ "dependsOn": "embedTarget",
381
+ "condition": "embedTarget === 'overlay'"
382
+ }
383
+ },
384
+ {
385
+ "name": "overlayBackgroundColor",
386
+ "type": "string",
387
+ "defaultValue": "#000000",
388
+ "inputController": {
389
+ "type": "colorPicker",
390
+ "helpText": "Set the color of the overlay background",
391
+ "description": "Overlay color",
392
+ "config": {
393
+ "showOpacityControls": true,
394
+ "defaultTransparency": 50
395
+ }
396
+ },
397
+ "visibilityCondition": {
398
+ "dependsOn": "addBackgroundColor",
399
+ "condition": "addBackgroundColor === true"
400
+ }
401
+ }
402
+ ]
403
+ }
404
+ ]
405
+ }
406
+ ]
407
+ }
408
+ ]
409
+ }
@@ -2,7 +2,10 @@
2
2
  * Parses a paste-ready Widgetic composition embed snippet into embed editor settings.
3
3
  * Accepts only output from the site `generateCompositionEmbedCode` and the gateway HTML embed generator.
4
4
  */
5
- import embedSchemaFile from '../../../static/embed-schema.json';
5
+ // The schema is read from this folder, not from static/: the package ships dist/ only, so a path to static/ points outside the
6
+ // installed package and breaks the build of every consumer. embedSchema.json is a copy of static/embed-schema.json that
7
+ // `npm run sync-embed-schema` refreshes (tests/package-imports.test.mjs fails when the two differ).
8
+ import embedSchemaFile from './embedSchema.json';
6
9
  const MAX_INPUT_LENGTH = 20_000;
7
10
  const ALLOWED_SDK_HOST = 'cdn.widgetic.com';
8
11
  const SDK_PATH_SUFFIX = '/sdks/browser/embed-sdk.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/editor",
3
- "version": "4.1.19",
3
+ "version": "4.1.20",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "llinks": "ls -la node_modules/@widgetic",
34
34
  "stop-dev": "lsof -i :5180 | awk 'NR>1 {print $2}' | xargs kill",
35
35
  "dev": "npm run sync-embed-schema && npm run stop-dev && npm run dev-sv",
36
- "sync-embed-schema": "node ../scripts/sync-embed-schema.mjs",
36
+ "sync-embed-schema": "node ../scripts/sync-embed-schema.mjs && node scripts/copy-embed-schema-into-lib.mjs",
37
37
  "dev-sv": "NODE_ENV=development vite dev --port 5180",
38
38
  "dev-open": "npm run dev -- --open",
39
39
  "render-build": "bash render-build.sh",