@widgetic/ui-sdk 0.1.12 → 0.1.14

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ui-sdk.js","sources":["../../src/sdk/utils/errors.ts","../../src/sdk/utils/validation.ts","../../src/sdk/core/theme-mode.ts","../../src/sdk/core/lifecycle.ts","../../src/sdk/core/local-events.ts","../../src/sdk/utils/config.ts","../../src/sdk/modules/loader.ts","../../src/sdk/loader/ui.ts","../../src/sdk/layers/index.ts","../../src/sdk/core/theme.ts","../../src/sdk/utils/security.ts","../../src/sdk/version.ts","../../src/index.ts","../../src/sdk/core/index.ts","../../src/sdk/core/events.ts","../../src/sdk/integration/host.ts","../../src/sdk/core/messaging.ts","../../src/sdk/core/state.ts","../../src/sdk/core/component.ts","../../src/sdk/utils/http.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["SDKErrorHandler","createError","message","code","error","Error","handleError","context","this","toSDKError","name","stack","details","ValidationError","constructor","field","super","SecurityError","ComponentError","componentId","ValidationUtils","validateId","id","trim","validateContainer","container","requireBrowser","element","document","querySelector","HTMLElement","rejectApiKey","options","loose","partner","undefined","apiKey","validateConfig","config","requiredFields","String","validateEventType","type","validTypes","includes","validateFileUpload","file","maxSize","allowedTypes","size","THEME_KEYS","MODES","DARK_SCHEME_QUERY","isMode","value","modeOfThemeOption","theme","mode","settingsOfThemeOption","Array","isArray","settings","Object","fromEntries","entries","filter","key","entry","keys","length","resolveMode","window","matchMedia","matches","themeForModule","own","pageWide","ownMode","ModuleMountError","moduleName","cause","setPrototypeOf","prototype","LifecycleManager","events","active","Map","mount","mountConfig","version","placeholder","loadingLabel","on","callbacks","signal","optionsWithContainer","moduleOptions","withoutContainer","instanceId","generateInstanceId","placeholderElement","showPlaceholder","module","stopListening","throwIfAborted","loaded","loader","load","getToken","partnerGetToken","apiUrl","locale","moduleDefaults","Module","async","getThemeMode","getThemeSettings","push","connectEvents","mounted","createMountedModule","set","hasOwnSettings","stop","unmountQuietly","remove","unmount","activeModule","get","delete","setThemeMode","values","tellModule","setDefaultTheme","modeChanged","setTheme","console","JSON","stringify","cleanup","results","Promise","allSettled","map","result","status","reason","stopFunctions","listen","eventName","handler","onReady","emit","payload","fatal","toError","onError","warn","off","setLanguage","language","createElement","setAttribute","assign","style","display","alignItems","justifyContent","boxSizing","width","minHeight","getComponentMinHeight","spinner","height","border","borderTopColor","borderRadius","animate","transform","duration","iterations","Infinity","appendChild","Date","now","Math","random","toString","slice","aborted","LocalEventEmitter","handlers","event","handlersForEvent","Set","add","data","timestamp","destroy","clear","DEFAULT_API_URL","DEFAULT_MODULE_BASE_URL","DEFAULT_CONFIG","NODE_ENV","API_URL","API_VERSION","CLIENT_URL","PRODUCTION_URL","CDN_URL","EMBED_SDK_URL","ConfigManager","getInstance","instance","initialize","getApiUrl","isProduction","getCdnUrl","ModuleLoadError","url","MODULE_NAME_PATTERN","VERSION_PATTERN","DEFAULT_RETRY_DELAYS_MS","importFromBrowser","specifier","import","ModuleLoader","loads","baseUrl","moduleBaseUrl","pageUrl","baseURI","URL","protocol","pathname","endsWith","resolveBaseUrl","fetchImpl","input","init","fetch","importImpl","retryDelaysMs","test","assertValidModuleName","pinnedVersion","assertValidVersion","cacheKey","existingLoad","pendingLoad","loadUncached","catch","entryUrl","manifest","fetchManifest","resolveEntryUrl","importModuleFile","href","manifestUrl","withRetries","response","credentials","ok","json","parseError","validateManifest","describeError","fail","manifestName","moduleFolder","staysInsideFolder","origin","startsWith","isScript","namespace","attemptIndex","retryUrl","searchParams","withRetryParameter","exported","default","operation","lastError","pause","resolve","setTimeout","sharedModuleLoaders","WidgeticUI","stopWatchingSystemTheme","assertValidOptions","moduleLoader","sharedModuleLoaderFor","themeMode","themeSettings","lifecycleManager","followSystemThemeWhenAsked","mountComponent","unmountComponent","getComponent","preload","updateTheme","given","every","isThemeOption","requestedMode","requestedSettings","resolvedMode","getTheme","onChange","query","listener","addEventListener","removeEventListener","watchSystemTheme","systemMode","mountModule","ui","sharedUIInstance","requireSharedUI","HighLevelUIAPI","newInstance","previousInstance","DEFAULT_THEME","colors","primary","secondary","background","surface","text","spacing","unit","scale","typography","fontFamily","DARK_THEME","SecurityManager","validateDomain","domain","cleanDomain","replace","toLowerCase","ALLOWED_DEV_ORIGINS","allowedOrigins","some","allowed","cleanAllowed","domainPart","DEVELOPMENT_CSP","defaultSrc","scriptSrc","styleSrc","imgSrc","connectSrc","frameAncestors","PRODUCTION_CSP","setupCSP","buildCSPString","cspConfig","directives","directive","join","validateOrigin","hostname","validateRequest","request","headers","csrfToken","validateCSRFToken","_token","validateMessage","sanitizeInput","SDK_VERSION","SDK_NAME","index","bridge","targetOrigin","hostHandlers","messageListener","parent","location","setupMessageListener","handleMessage","MessagePort","onmessage","forEach","emitError","source","has","eventData","sendToHost","postMessage","errorEvent","err","close","security","boundHandleMessage","setupMessageHandling","createSecureChannel","channel","MessageChannel","port2","port1","state","listeners","snapshots","maxSnapshots","setState","componentState","oldValue","snapshot","createSnapshot","silent","notifyStateChange","getState","getComponentState","subscribe","callback","unsubscribe","componentSnapshots","shift","restoreSnapshot","newValue","initialTheme","activePreset","currentTheme","createDefaultTheme","setupSystemThemeListener","getCurrentTheme","updates","newTheme","mergeThemes","validateTheme","applyTheme","notifyThemeUpdate","setMode","applyColorScheme","e","base","isValidColor","color","documentElement","setProperty","shadow","initializeShadowDOM","attachShadow","cssText","CSSStyleSheet","themeStyleSheet","adoptedStyleSheets","replaceSync","textContent","Headers","Request","contentType"],"mappings":"0PAUaA,EAQT,kBAAOC,CAAYC,EAAiBC,GAChC,MAAMC,EAAQ,IAAIC,MAAMH,GAExB,OADCE,EAAwBD,KAAOA,EACzBC,CACX,CASA,kBAAOE,CAAYF,EAAgBG,GAE/B,OAAIH,aAAiBC,MACZD,EAAwBD,KAClBC,EAEJI,KAAKP,YAAYG,EAAMF,QAAS,iBAItB,iBAAVE,E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","sources":["../../src/sdk/utils/errors.ts","../../src/sdk/utils/validation.ts","../../src/sdk/core/theme-mode.ts","../../src/sdk/core/lifecycle.ts","../../src/sdk/core/local-events.ts","../../src/sdk/utils/config.ts","../../src/sdk/modules/loader.ts","../../src/sdk/loader/ui.ts","../../src/sdk/layers/index.ts","../../src/sdk/core/theme.ts","../../src/sdk/utils/security.ts","../../src/sdk/version.ts","../../src/index.ts","../../src/sdk/core/index.ts","../../src/sdk/core/events.ts","../../src/sdk/integration/host.ts","../../src/sdk/core/messaging.ts","../../src/sdk/core/state.ts","../../src/sdk/core/component.ts","../../src/sdk/utils/http.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["SDKErrorHandler","createError","message","code","error","Error","handleError","context","this","toSDKError","name","stack","details","ValidationError","constructor","field","super","SecurityError","ComponentError","componentId","ValidationUtils","validateId","id","trim","validateContainer","container","requireBrowser","element","document","querySelector","HTMLElement","rejectApiKey","options","loose","partner","undefined","apiKey","validateConfig","config","requiredFields","String","validateEventType","type","validTypes","includes","validateFileUpload","file","maxSize","allowedTypes","size","THEME_KEYS","MODES","DARK_SCHEME_QUERY","isMode","value","modeOfThemeOption","theme","mode","settingsOfThemeOption","Array","isArray","settings","Object","fromEntries","entries","filter","key","entry","keys","length","resolveMode","window","matchMedia","matches","themeForModule","own","pageWide","ownMode","ModuleMountError","moduleName","cause","setPrototypeOf","prototype","LifecycleManager","events","active","Map","mount","mountConfig","version","placeholder","loadingLabel","on","callbacks","signal","optionsWithContainer","moduleOptions","withoutContainer","instanceId","generateInstanceId","placeholderElement","showPlaceholder","module","stopListening","throwIfAborted","loaded","loader","load","getToken","partnerGetToken","apiUrl","locale","moduleDefaults","Module","async","getThemeMode","getThemeSettings","push","connectEvents","mounted","createMountedModule","set","hasOwnSettings","stop","unmountQuietly","remove","unmount","activeModule","get","delete","setThemeMode","values","tellModule","setDefaultTheme","modeChanged","setTheme","console","JSON","stringify","cleanup","results","Promise","allSettled","map","result","status","reason","stopFunctions","listen","eventName","handler","onReady","emit","payload","fatal","toError","onError","warn","off","setLanguage","language","createElement","setAttribute","assign","style","display","alignItems","justifyContent","boxSizing","width","minHeight","getComponentMinHeight","spinner","height","border","borderTopColor","borderRadius","animate","transform","duration","iterations","Infinity","appendChild","Date","now","Math","random","toString","slice","aborted","LocalEventEmitter","handlers","event","handlersForEvent","Set","add","data","timestamp","destroy","clear","DEFAULT_API_URL","DEFAULT_MODULE_BASE_URL","DEFAULT_CONFIG","NODE_ENV","API_URL","API_VERSION","CLIENT_URL","PRODUCTION_URL","CDN_URL","EMBED_SDK_URL","ConfigManager","getInstance","instance","initialize","getApiUrl","isProduction","getCdnUrl","ModuleLoadError","url","MODULE_NAME_PATTERN","VERSION_PATTERN","DEFAULT_RETRY_DELAYS_MS","importFromBrowser","specifier","import","ModuleLoader","loads","baseUrl","moduleBaseUrl","pageUrl","baseURI","URL","protocol","pathname","endsWith","resolveBaseUrl","fetchImpl","input","init","fetch","importImpl","retryDelaysMs","test","assertValidModuleName","pinnedVersion","assertValidVersion","cacheKey","existingLoad","pendingLoad","loadUncached","catch","entryUrl","manifest","fetchManifest","resolveEntryUrl","importModuleFile","href","manifestUrl","withRetries","response","credentials","ok","json","parseError","validateManifest","describeError","fail","manifestName","moduleFolder","staysInsideFolder","origin","startsWith","isScript","namespace","attemptIndex","retryUrl","searchParams","withRetryParameter","exported","default","operation","lastError","pause","resolve","setTimeout","sharedModuleLoaders","WidgeticUI","stopWatchingSystemTheme","assertValidOptions","moduleLoader","sharedModuleLoaderFor","themeMode","themeSettings","lifecycleManager","followSystemThemeWhenAsked","mountComponent","unmountComponent","getComponent","preload","updateTheme","given","every","isThemeOption","requestedMode","requestedSettings","resolvedMode","getTheme","onChange","query","listener","addEventListener","removeEventListener","watchSystemTheme","systemMode","mountModule","ui","sharedUIInstance","requireSharedUI","HighLevelUIAPI","newInstance","previousInstance","DEFAULT_THEME","colors","primary","secondary","background","surface","text","spacing","unit","scale","typography","fontFamily","DARK_THEME","SecurityManager","validateDomain","domain","cleanDomain","replace","toLowerCase","ALLOWED_DEV_ORIGINS","allowedOrigins","some","allowed","cleanAllowed","domainPart","DEVELOPMENT_CSP","defaultSrc","scriptSrc","styleSrc","imgSrc","connectSrc","frameAncestors","PRODUCTION_CSP","setupCSP","buildCSPString","cspConfig","directives","directive","join","validateOrigin","hostname","validateRequest","request","headers","csrfToken","validateCSRFToken","_token","validateMessage","sanitizeInput","SDK_VERSION","SDK_NAME","index","bridge","targetOrigin","hostHandlers","messageListener","parent","location","setupMessageListener","handleMessage","MessagePort","onmessage","forEach","emitError","source","has","eventData","sendToHost","postMessage","errorEvent","err","close","security","boundHandleMessage","setupMessageHandling","createSecureChannel","channel","MessageChannel","port2","port1","state","listeners","snapshots","maxSnapshots","setState","componentState","oldValue","snapshot","createSnapshot","silent","notifyStateChange","getState","getComponentState","subscribe","callback","unsubscribe","componentSnapshots","shift","restoreSnapshot","newValue","initialTheme","activePreset","currentTheme","createDefaultTheme","setupSystemThemeListener","getCurrentTheme","updates","newTheme","mergeThemes","validateTheme","applyTheme","notifyThemeUpdate","setMode","applyColorScheme","e","base","isValidColor","color","documentElement","setProperty","shadow","initializeShadowDOM","attachShadow","cssText","CSSStyleSheet","themeStyleSheet","adoptedStyleSheets","replaceSync","textContent","Headers","Request","contentType"],"mappings":"0PAUaA,EAQT,kBAAOC,CAAYC,EAAiBC,GAChC,MAAMC,EAAQ,IAAIC,MAAMH,GAExB,OADCE,EAAwBD,KAAOA,EACzBC,CACX,CASA,kBAAOE,CAAYF,EAAgBG,GAE/B,OAAIH,aAAiBC,MACZD,EAAwBD,KAClBC,EAEJI,KAAKP,YAAYG,EAAMF,QAAS,iBAItB,iBAAVE,EACAI,KAAKP,YAAYG,EAAO,gBAI5BI,KAAKP,YACR,oBAAoBM,IACpB,gBAER,CAQA,iBAAOE,CAAWL,GACd,MAAO,CACHF,QAASE,EAAMF,QACfC,KAAOC,EAAwBD,MAAQ,gBACvC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,gBAAiBA,cAAc3W,WAC/B1E,KAAKib,QACL,uBAAwBjb,KAAKib,OAE7B,IAMI,OALKjb,KAAKsb,kBACNtb,KAAKsb,gBAAkB,IAAID,cAC3Brb,KAAKib,OAAOM,mBAAqB,IAAIvb,KAAKib,OAAOM,mBAAoBvb,KAAKsb,uBAE9Etb,KAAKsb,gBAAgBE,YAAYJ,EAErC,CAAE,MAEF,CAIJ,IAAIxR,EAAQ5J,KAAKib,OAAO5Z,cAAc,8BACjCuI,IACDA,EAAQxI,SAASqI,cAAc,SAC/BG,EAAMF,aAAa,sBAAuB,QAC1C1J,KAAKib,OAAOnQ,YAAYlB,IAE5BA,EAAM6R,YAAcL,CACxB,mDRoLE,SAA8BvG,EAA2B,IAC3D,MAAMoD,EAAW,IAAI3D,EAAgBO,GAErC,MAAO,CACH2B,gBAAkBhL,GAAwByM,EAASzB,gBAAgBhL,GACnEwK,eAAiB1F,GAAmB2H,EAASjC,eAAe1F,GAC5DmG,gBAER,iCSjUoCvJ,EAAa1L,EAAuB,IACpE,MAAM4U,EAAU,IAAIsF,QAAQla,EAAQ4U,SAKpC,OAFAA,EAAQnP,IAAI,mBAAoB,kBAEzB,IAAI0U,QAAQzO,EAAK,IACjB1L,EACH4U,UACAxG,YAAa,eAErB,0ETkR+BU,EAAgBuE,EAA2B,IAEtE,OADiB,IAAIP,EAAgBO,GACrBmB,eAAe1F,EACnC,qBS9QM,SAA2BX,GAE7B,IAAKA,EAASE,GACV,OAAO,EAIX,MAAM+L,EAAcjM,EAASyG,QAAQ5O,IAAI,gBAKzC,OAJIoU,IAAgBA,EAAYxZ,SAAS,qBACrC4F,QAAQqB,KAAK,2BAA4BuS,IAGtC,CACX"}
package/modules/README.md CHANGED
@@ -199,6 +199,7 @@ Without the SDK it is the same class as the File Browser's (`new CompositionEdit
199
199
  | `googleFontsApiKey` | A Google Fonts Web Fonts API key for the font picker's list. Without one the picker lists a short set of popular families. |
200
200
  | `autosaveDelayMs` | Save this many milliseconds after the last change. Default 2500; `0` saves only when you call `save()`. |
201
201
  | `lockPreviewSize` | When `true`, resizing the preview changes how it looks in the editor but does not update `embedSettings.width` and `embedSettings.height` on save (you control embed size elsewhere). Default: `false`. |
202
+ | `presence` | `true` tells the people of a team who else has the composition open: "Anna is editing", with a choice to take over or to only look (default `false`, read once when the module mounts; see "Who else is editing"). It is for a token that signs a person in as themselves (a Shopify store's, the Widgetic site's); for an editor session minted for one of your customers, the API refuses the routes it runs on and the editor carries on as if it were off, without asking again. It is presence, never a lock: nobody is shut out, and a save that finds the composition changed by somebody else asks the visitor what to do (see "When somebody else saved first") whether `presence` is on or not. A value that is not `true` or `false` is ignored, with one warning in the console. |
202
203
  | `theme` | As for every module: a mode, or a look of your own (see "Looking like your product"). |
203
204
  | `locale` | A BCP 47 language tag (`de`, `pt-BR`): plural rules and how numbers and dates are written (including month and weekday names in calendars). When a translation pack exists for the tag, the module loads it as a lazy file; otherwise words stay English while formatting and direction still follow `locale`. See "Speaking your visitors' language". |
204
205
  | `messages` | The editor's words in your language, `{ 'editor.props.save': 'Speichern', ... }`: **one** object for the whole editor, the file picker and the rich text editor. A key you leave out stays English. See "Speaking your visitors' language". |
@@ -207,7 +208,8 @@ Without the SDK it is the same class as the File Browser's (`new CompositionEdit
207
208
  Events: `ready` `{ name, widgetId }` (the composition has loaded and is on screen), `dirty` `{ dirty }` (there is, or is
208
209
  no longer, work that is not saved), `saved` `{ composition, savedAt }` (a save went through), `conflict`
209
210
  `{ currentVersion, lastEditedBy, lastEditedAt, correlationId? }` and `conflictResolved` `{ resolution }` (see "When somebody
210
- else saved first" below), and `error`
211
+ else saved first" below), `presence` `{ phase, holder, editsBlocked }` (with the `presence` option: who is editing changed;
212
+ see "Who else is editing" below), and `error`
211
213
  `{ message, code?, fatal, during?, status?, retryable?, sessionEnded?, correlationId? }`. The editor shows a problem to the
212
214
  visitor itself (with "Try again" where that helps); `error` is for your page. `fatal: true` means the editor cannot go on
213
215
  by itself: the composition cannot be opened, or the session is over (`sessionEnded`), so give it a new session or take it
@@ -222,10 +224,34 @@ a deliberate overwrite; when somebody saved a third time meanwhile it asks again
222
224
  *Use the latest version* (the composition is read again and the edits are dropped). Your page hears `conflict` when the
223
225
  save is refused and `conflictResolved` (`{ resolution: 'keepMine' | 'loadLatest' }`) once somebody chose. It is not an
224
226
  `error`, so `error` is not sent for it. A page that wants its own buttons calls `keepMyChanges()` or `loadLatestVersion()`
225
- on the module. The API names who saved only to a member of a team (it never tells an editor session), so `lastEditedBy`
226
- and `lastEditedAt` are `null` here; `currentVersion` is the version the API holds now, when the refusal said so. The
227
- editor's *presence* notice ("Anna is editing", take over, read only) is not offered by the module: it runs on routes an
228
- editor session may not call, and the module keeps the `presence` option of the editor off.
227
+ on the module. The API names who saved only to a member of a team (it never tells an editor session), so for an editor
228
+ session `lastEditedBy` and `lastEditedAt` are `null`; for a person signed in as themselves they say who saved last (a name,
229
+ never an email) and when. `currentVersion` is the version the API holds now, when the refusal said so. Telling two people
230
+ about each other *before* either saves is the `presence` option's job (next).
231
+
232
+ **Who else is editing.** A version check tells two people about each other only when the second one saves. With
233
+ `presence: true` the editor tells them earlier: while a person has the composition open the editor keeps a claim with the
234
+ API (renewed about every 20 seconds while the window is on screen, given back when the editor closes or the page goes, and
235
+ it runs out by itself a minute after the last renewal), and a second person who opens the composition sees a card, "Anna is
236
+ editing", with two choices: *Take over editing* (the other person's editor pauses and says so; what they saved stays) and
237
+ *Look only* (this window stays read-only, with a note that says who is editing, or that nobody is any more, and a button to
238
+ start). The same person in two windows is two editors, and the second window says "You are editing this composition in
239
+ another window". It is presence, never a lock: nobody is shut out (taking over is always one click away), no save is
240
+ refused because of it, and the version check above still guards every save. The API names the person only to a member of a
241
+ team, and never by email; without a name the card says "Someone".
242
+
243
+ Your page hears `presence` `{ phase, holder, editsBlocked }` when something a person can see changes (never on every
244
+ renewal): `phase` is `'editing'` (this window holds the claim), `'blocked'` (somebody else does and the card asks),
245
+ `'readOnly'` (the visitor chose to only look) or `'off'` (presence was on and has stopped, so a page that held its screens
246
+ still can let them save again); `holder` is `{ id, name, isYou, since }` or `null` (`name` is `null` when the API gave
247
+ none, `isYou` is `true` for the visitor's own account in another window, `since` is when the holder began, an ISO date, when
248
+ the API said); `editsBlocked` is `true` in `'blocked'` and `'readOnly'`. A page that has screens of its own which save the
249
+ composition holds them still while `editsBlocked` is `true`, or asks `editor.module.isEditsBlocked()` before it opens one;
250
+ what was edited before is saved as usual. Every doubt means "edit freely": for an editor session, a personal composition, a
251
+ person who may not change it, an API that cannot be reached or an answer the editor cannot read, the editor carries on as
252
+ if the option were off (it asks again later when the network was the cause, never when the API refused for good), and your
253
+ page hears nothing. The words follow the page's language like the rest of the editor's (see "Speaking your visitors'
254
+ language").
229
255
 
230
256
  Methods (on `editor.module` when you mounted it with the SDK): `save()` saves what is unsaved now, `flush()` saves
231
257
  everything and waits, both resolving `true` when nothing is left unsaved; `isDirty()`; `reload()` loads the composition
@@ -233,7 +259,9 @@ again (unsaved edits are lost); `adoptEmbedSettings(settings)` for a page that s
233
259
  (call it after `await flush()`, with the settings the API now holds, so a later save of the editor does not put the old ones
234
260
  back; nothing becomes unsaved); `adoptName(name)` for a page that renames the composition itself (same use); `keepMyChanges()`
235
261
  (resolves `true` when nothing is left unsaved) and `loadLatestVersion()`, the two answers to a `conflict` for a page with buttons of its own (both do nothing, and
236
- `keepMyChanges()` resolves `false`, when there is no conflict); `setTheme(theme)` (see "Looking like your product"); `setLanguage({ locale?, messages? })`, and
262
+ `keepMyChanges()` resolves `false`, when there is no conflict); `isEditsBlocked()` (`true` while the editor takes no new edit
263
+ because somebody else is editing, the same as `editsBlocked` of the last `presence`; always `false` without the `presence`
264
+ option, before the editor is on screen and after it is gone); `setTheme(theme)` (see "Looking like your product"); `setLanguage({ locale?, messages? })`, and
237
265
  `CompositionEditorModule.defaultMessages` and `checkMessages(messages)`, which are also on the instance (see "Speaking your
238
266
  visitors' language").
239
267
 
@@ -414,7 +442,12 @@ canvas of Composition, Trigger and Condition blocks that go forward only (up to
414
442
  a draft that is saved while you work, publish and discard, a history of versions that never change, a Test run that plays a
415
443
  visitor through the draft, a Runs tab with how many visitors went through each block, and a Settings tab (time zone, embed
416
444
  code, pause, archive, duplicate, delete). A trigger is enabled for a composition only when its widget can supply it (values a
417
- visitor adds need a Pro widget that keeps data); the reason is told next to the choice. The package's README lists it all.
445
+ visitor adds need a Pro widget that keeps data); the reason is told next to the choice. *New workflow* asks for a name and for
446
+ where to start: a blank workflow, or a starting point (a preset) the workspace is offered, which is Widgetic's for a person with a
447
+ Widgetic account and the partner's for a partner's customer (an editor session); a pick gives the person their own copy of the
448
+ preset's widgets and a draft workflow wired like it, and nothing they change reaches the preset. A workflow can be deleted in any
449
+ state, after a confirmation that says what goes with it by how far it got (only a draft; or versions and counts too; and, for a
450
+ live one, that embeds then show only their first composition). The package's README lists it all.
418
451
 
419
452
  ```js
420
453
  import { mountModule } from '@widgetic/ui-sdk';
@@ -440,14 +473,27 @@ window.addEventListener('popstate', () => workflows.module.setWorkflow(workflowO
440
473
  | Option | What it does |
441
474
  | --- | --- |
442
475
  | `container` | The element the screen fills (it needs a height). |
443
- | `workspaceId` | **Required.** `personal`, or the id of the organization whose workflows are shown and edited. |
444
- | `getToken` | **Required**, and the same as for the other modules: `getToken({ reason })` resolves with a token the API accepts for the workspace's workflows, bare or as `{ token, expiresAt }`. It must be the token of a **signed-in person who may work in that workspace** (a member of the team, or the partner's own account), the way the Widgetic site calls the API: an *editor session* minted for one of a partner's customers is refused on these routes (`403`), because an editor session may call only what its allow-list names and workflows are not on it. It is called once before the screen appears (a `getToken` that fails fails the mount), and again when the token is about to run out or the API refuses it (`reason: 'expired'`, once per refusal). |
476
+ | `workspaceId` | **Required.** `personal`, or the id of the organization whose workflows are shown and edited. With an editor session (below) it is `personal`: a session may call only `/workspaces/personal/workflows…`. |
477
+ | `getToken` | **Required**, and the same as for the other modules: `getToken({ reason })` resolves with a token the API accepts for the workspace's workflows, bare or as `{ token, expiresAt }`. Two kinds work: the token of a **signed-in person who may work in that workspace** (a member of the team, or the partner's own account), the way the Widgetic site calls the API, or an **editor session** your server minted for one of your customers with `surfaces: ['workflows']` ("Showing it to your customers"). It is called once before the screen appears (a `getToken` that fails fails the mount), and again when the token is about to run out or the API refuses it (`reason: 'expired'`, once per refusal). |
445
478
  | `apiUrl` | The API origin (`https://api.widgetic.com` unless you run your own). |
446
479
  | `workflowId` | The workflow to open first. Leave it out for the list. After mounting the screen moves by itself (and says so with `openWorkflow`); `setWorkflow` moves it from the page. |
447
480
  | `presence` | `true` tells the people of a team who else has the workflow open: "Anna is editing", with a choice to take over or to only look (default `false`, read once when the module mounts). It is for an organization's workspace and a person who may change the workflow; for `personal`, or for a token the edit-lease routes refuse (an editor session), the screen carries on as if it were off, without asking again. It is presence, never a lock: nobody is shut out, and a save that finds the draft changed by somebody else asks the person what to do (*Keep my changes as a copy* first, if they like, then *Load the latest version*) whether `presence` is on or not. A value that is not `true` or `false` is ignored, with one warning in the console. |
448
481
  | `theme`, `themeFromHost` | The colours, the corners and the typeface ("Looking like your product"). |
449
482
  | `locale`, `messages` | The language ("Speaking your visitors' language"). |
450
483
 
484
+ **Showing it to your customers.** A partner that has a Widgetic account for each of its customers (managed users) mounts the
485
+ screen with an *editor session*: its server mints one for the customer exactly as for the other modules (`POST
486
+ /v1/managed-users/{id}/editor-sessions`) with `surfaces: ['workflows']`, and `getToken` returns it. Pass `workspaceId:
487
+ 'personal'`. A session may call only the workflow routes of that workspace, so any other value is refused with
488
+ `EDITOR_SESSION_ROUTE_NOT_ALLOWED` and the screen **shows** the refusal with a "Try again" button instead of an empty list.
489
+ The customer sees and edits **their own workflows only**: another customer's workflow answers "not found", the same as one
490
+ that does not exist. A block that runs a composition offers **their own compositions** and nobody else's, and a workflow
491
+ cannot name a foreign one. Each customer can hold up to 50 workflows (archived ones count; a 51st is refused with a message
492
+ the screen shows). Names of the people who published a version are not shown to a customer. Your account owns, bills and
493
+ serves what a customer makes (the customer is only a tag on it), so what a customer's workflow does to a visitor is covered
494
+ by your plan and your standing, and your own staff, signed in as the partner, see every customer's workflows in the same
495
+ screen.
496
+
451
497
  **What it tells the page.** `ready`, with no payload, once the screen is drawn. `openWorkflow` `{ workflowId }`: the person
452
498
  opened a workflow, or went back to the list (`workflowId: null`), so the page can keep its address in step.
453
499
  `showEmbedCode` `{ workflowId }`: the person asked for the tag of a workflow. The page shows it, because it knows how the tag
@@ -456,7 +502,10 @@ mounts**. `error` `{ message, code?, fatal }`: `fatal: true` when it could not s
456
502
  console says `[widgetic-ui] Workflows failed to start:` with the cause), and `fatal: false` for `RENDER_FAILED` (a part of
457
503
  the screen could not be drawn: the rest stays and the visitor is offered "Try again" in its place), `REQUEST_FAILED` (a
458
504
  request to the API failed: the screen tells the person by itself), `SESSION_ENDED` (the API no longer accepts the token
459
- `getToken` gives) and `TOKEN_REFRESH_FAILED`. The events are not typed in the SDK yet (see "Known gaps of Workflows").
505
+ `getToken` gives) and `TOKEN_REFRESH_FAILED`. The SDK types the events (`WorkflowsEvents`): `mountModule('workflows', …)`
506
+ checks the names in `on` and what each handler is given. To type `workflows.module` as well, give both type arguments
507
+ (`mountModule<WorkflowsModule, 'workflows'>('workflows', …)`); the form with one type argument is for the modules that have
508
+ an overload of their own and does not compile for Workflows (see "Known gaps of Workflows").
460
509
 
461
510
  **What it puts on your page.** What every module does, and nothing else: one `<widgetic-ui-module>` in your container and
462
511
  the namespaced `<style>` of font rules in `<head>`. Its menus, dialogs and the canvas's own pieces stay inside the shadow
@@ -484,7 +533,8 @@ sets `:root { --primary: yellow }` repaints the module. It also reads the text c
484
533
 
485
534
  **What the tests check.** `tests/workflowsModule.test.ts` for the module's logic. On the hostile page
486
535
  (`harness/workflows.html`, with the mock API of `harness/mockWorkflows.mjs`; `?theme=`, `?themeFromHost=1`, `?height=`,
487
- `?mount=no`, `?locale=`, `?messages=`, `?pseudo=1`, `?workflow=`, `?workspace=`, `?embedCode=yes`, `?lifetime=`):
536
+ `?mount=no`, `?locale=`, `?messages=`, `?pseudo=1`, `?workflow=`, `?workspace=`, `?embedCode=yes`, `?lifetime=`,
537
+ `?customer=userA|userB|userNew`):
488
538
  `e2e/workflowsModule.spec.ts` (the page is not touched and nothing is left behind, the requests it makes, the
489
539
  Content-Security-Policies, how well the text reads in four looks), `e2e/workflowsEditor.spec.ts` (the list and its
490
540
  questions to the API, opening and making a workflow, the canvas drawn among the page's own CSS, adding and connecting
@@ -492,7 +542,29 @@ blocks with a real mouse drag, publishing with its `Idempotency-Key` and revisio
492
542
  and that taking the screen away in the middle of an edit leaves nothing behind),
493
543
  `e2e/workflowsLanguage.spec.ts` (the pseudo language: every word a visitor can read is a message; `messages`,
494
544
  `setLanguage`, `checkMessages`) and `e2e/workflowsRtl.spec.ts` (the screen, its list and its editor mirrored for
495
- `locale: 'ar'` without a word of Arabic, and not decided by the page's own direction). The themes matrix
545
+ `locale: 'ar'` without a word of Arabic, and not decided by the page's own direction).
546
+
547
+ The mock holds two kinds of caller to two sets of rules. A token that names a customer (`?customer=userA`, `userB` or
548
+ `userNew` give the page one: `wgt_ses_harness_userA_1` ...) is an **editor session**, and `harness/creatorDoor.mjs` holds it
549
+ to **the gateway's own list of what a session may call** (`harness/fixtures/editorSessionRoutes.json`, the 19 rows of the
550
+ `workflows` surface, all on `/workspaces/personal/workflows`): a route that is not on the list is refused with `403
551
+ EDITOR_SESSION_ROUTE_NOT_ALLOWED`, a body field the row does not list with `403 EDITOR_SESSION_FIELD_NOT_ALLOWED`, and a
552
+ workflow that is another customer's answers `404 RESOURCE_WORKFLOW_NOT_FOUND` ("Workflow not found"), exactly as one that does
553
+ not exist, before the workflow is looked up. A customer sees, makes and changes their own workflows only, their workflows have
554
+ UUIDs, and a version shows no publisher. Any other token is the signed-in person the first four specs use, without the door.
555
+ Two routes are about where a workflow starts: the mock lists two presets (`GET .../workflows/presets`) and makes a draft of the
556
+ caller's own from either (`POST .../workflows/from-preset`: an `Idempotency-Key` is needed, a preset that is not offered is
557
+ `404 RESOURCE_WORKFLOW_PRESET_NOT_FOUND`, the name is the preset's title when none is given), and a workflow is deleted in any
558
+ state (`{ removed: true }`, and "not found" from then on), as the gateway does. The module draws the starting-point picker of
559
+ *New workflow* and the confirmation of a delete from the release of `@widgetic/workflows` it carries.
560
+ `tests/mockWorkflowsDoor.test.mjs` checks the mock's side of it (its mutations are killed one by one), and
561
+ `e2e/workflowsSession.spec.ts` checks the module's: it asks the API for the workflow routes of `personal` and nothing else,
562
+ with the session as its bearer; it shows a customer their own workflows and no one else's; making, opening, changing and saving
563
+ a workflow sends only calls and body fields the allow-list names; so does starting from a preset (what the dialog offers, the
564
+ name, the key that makes a retry safe, a preset that is gone, presets that cannot be read while the blank start keeps working);
565
+ a delete asks first, says what goes with the workflow by how far it got, sends nothing until the person agrees and then sends
566
+ one delete for the customer's own workflow; and a refusal (another customer's workflow, a workspace other than `personal`) is
567
+ shown to the person with a way to try again and reported to the page with an `error`, never hidden behind an empty list. The themes matrix
496
568
  (`e2e/themes.spec.ts`) and the React page (`e2e/reactPage.spec.ts`) run it too, and `e2e/sdkLoader.spec.ts` checks that the
497
569
  theme the page sets through the SDK reaches it.
498
570
 
@@ -647,7 +719,7 @@ files.setLanguage({ locale: 'de', messages: germanMessages }); // later, while i
647
719
  | `selectLabel` | The text of the button that hands the pick to your page, for a page that only wants to rename that one button (default "Select"). `messages['action.addToEditor']` does the same and wins when both are given. |
648
720
  | `setLanguage({ locale?, messages? })` | On the handle (`files.setLanguage`) and on a module you made yourself. Changes the language at once, while the module is on screen or before `mount()`. A value the call leaves out keeps what it was. `messages` it gives **replace** all the earlier ones: a page that switches from German to French passes the French only, and `setLanguage({ locale: '', messages: {} })` goes back to English. `null` counts as "not said". When `locale` changes, the module loads the matching pack (if any) and applies it in one step; two quick calls end in the language of the last call. |
649
721
 
650
- **Translation packs (shipped languages).** Each pack is one lazy file next to `index.js` (gzip budget per pack: File Browser **5 kB**, composition editor **9 kB**, widget creator **28 kB**, Workflows **9 kB**; the build fails when a pack grows past its module's budget). **Twelve** languages ship today as lazy JSON packs on the CDN: the eight left-to-right ones (`fr`, `de`, `es`, `pt-BR`, `nl`, `da`, `sv`, `zh-CN`) and four right-to-left ones (`ar`, `he`, `fa`, `ur`; Hebrew also answers to the legacy tag `iw`). Every pack is **provisional** until a native speaker has reviewed it. Each module exposes `Module.supportedLocales` (the list above) and `Module.localePackStatus(tag)` (`'provisional' | 'reviewed' | null`). Master files for translators live in `modules/locales/<tag>.json` (union of all keys, with the 416 of Workflows); the build splits them into one pack per module. Missing keys in a pack fall back to English. **Merge order:** pack → module English shortcuts (`selectLabel`, `presetLabels`, the File Browser's "Select" / "Files selected" toasts) → your `messages` (your page always wins). **Fallback examples:** `pt-PT` and `pt` → `pt-BR` pack; `fr-CA` → `fr`; `zh` / `zh-Hans` / `zh-SG` → `zh-CN`; `zh-TW` / `zh-Hant` → no pack (English words, Simplified is not used); `ar-SA`, `ar-EG` → `ar`; `he-IL` and `iw` → `he`; `fa-IR`, `fa-AF` → `fa`; `ur-PK`, `ur-IN` → `ur`; `en*` → no pack; unknown tag → English (no console line). A pack file that fails to load is reported once in the console; the module keeps working in English. On `mount()`, the module waits for the pack in parallel with its session token so the first paint can be in the pack language when the file arrives in time (Workflows waits for the token and the pack both before it draws anything, so its first paint is always in the language). Commands: `npm run locales:export-english`, `locales:import-shopify`, `locales:coverage`. Report a wrong translation to Widgetic support with the module name, `locale`, message key and what you expected.
722
+ **Translation packs (shipped languages).** Each pack is one lazy file next to `index.js` (gzip budget per pack: File Browser **5 kB**, composition editor **9 kB**, widget creator **28 kB**, Workflows **10 kB**; the build fails when a pack grows past its module's budget). **Twelve** languages ship today as lazy JSON packs on the CDN: the eight left-to-right ones (`fr`, `de`, `es`, `pt-BR`, `nl`, `da`, `sv`, `zh-CN`) and four right-to-left ones (`ar`, `he`, `fa`, `ur`; Hebrew also answers to the legacy tag `iw`). Every pack is **provisional** until a native speaker has reviewed it. Each module exposes `Module.supportedLocales` (the list above) and `Module.localePackStatus(tag)` (`'provisional' | 'reviewed' | null`). Master files for translators live in `modules/locales/<tag>.json` (union of all keys, with the 431 of Workflows); the build splits them into one pack per module. Missing keys in a pack fall back to English. **Merge order:** pack → module English shortcuts (`selectLabel`, `presetLabels`, the File Browser's "Select" / "Files selected" toasts) → your `messages` (your page always wins). **Fallback examples:** `pt-PT` and `pt` → `pt-BR` pack; `fr-CA` → `fr`; `zh` / `zh-Hans` / `zh-SG` → `zh-CN`; `zh-TW` / `zh-Hant` → no pack (English words, Simplified is not used); `ar-SA`, `ar-EG` → `ar`; `he-IL` and `iw` → `he`; `fa-IR`, `fa-AF` → `fa`; `ur-PK`, `ur-IN` → `ur`; `en*` → no pack; unknown tag → English (no console line). A pack file that fails to load is reported once in the console; the module keeps working in English. On `mount()`, the module waits for the pack in parallel with its session token so the first paint can be in the pack language when the file arrives in time (Workflows waits for the token and the pack both before it draws anything, so its first paint is always in the language). Commands: `npm run locales:export-english`, `locales:import-shopify`, `locales:coverage`. Report a wrong translation to Widgetic support with the module name, `locale`, message key and what you expected.
651
723
 
652
724
  **`action.addToEditor` vs Shopify.** The confirm button of the file picker is the message `action.addToEditor`. In these modules its English text is **Select** (`selectLabel` is a shortcut for the same key; `messages` wins over both). Packs seeded from the Shopify app's File Browser used Shopify's wording ("Add to Editor") for that key; the import script replaces it with Select in each language. There is no separate `action.select` key in the module catalogs (Shopify's JSON may list `action.select` for another button).
653
725
 
@@ -769,10 +841,9 @@ and it splits what you give between them, so you never need to know which part s
769
841
  - the rich text editor of its text fields, the `shadEditor.` keys. The editor draws its own text toolbar (`editor.` keys),
770
842
  so these words are not on screen today, and a translation can leave them out.
771
843
 
772
- Among the `editor.` keys, the nineteen `editor.presence.` ones ("Anna is editing", take over, look only) are on no screen
773
- either: the module keeps the editor's `presence` off, because it runs on routes an editor session may not use. The language
774
- packs leave them out (`npm run locales:coverage` counts them as missing for that reason); the nine `editor.conflict.` ones,
775
- which the card of a refused save shows, are translated.
844
+ Among the `editor.` keys, the nineteen `editor.presence.` ones ("Anna is editing", take over, look only) are on screen only
845
+ with the `presence` option, and the nine `editor.conflict.` ones only when a save is refused because somebody else saved
846
+ first; the language packs carry both, so a page that sets `locale` has them translated either way.
776
847
 
777
848
  `CompositionEditorModule.defaultMessages` lists all of them, with their English text: more than 500. A key that is in none
778
849
  of the three parts is said once in the console as `[Editor] ...`, with the nearest real key, and ignored.
@@ -871,15 +942,15 @@ creator.setLanguage({ locale: 'de', messages: germanMessages }); // every screen
871
942
  code stay left to right.
872
943
 
873
944
  **Workflows.** It takes the same `locale`, `messages`, `setLanguage`, `defaultMessages` and `checkMessages`, with **one**
874
- `messages` object for all of it: its 416 `workflows.` keys (the list, the editor and its panels, the names of blocks,
945
+ `messages` object for all of it: its 431 `workflows.` keys (the list, the editor and its panels, the names of blocks,
875
946
  operators and units, what the engine finds wrong with a workflow, what a failed request means, and the words of the screen
876
947
  that says a part could not be drawn). The words of a block are made of parts the screen puts together (`{field} {value}`,
877
948
  `{count, plural, ...}`), so a language that puts them in another order can say so in its own message.
878
949
 
879
950
  - **It speaks the twelve languages of the other modules.** `Workflows.supportedLocales` lists them (`fr`, `de`, `es`,
880
951
  `pt-BR`, `nl`, `da`, `sv`, `zh-CN`, `ar`, `he`, `fa`, `ur`) and `Workflows.localePackStatus(tag)` is `'provisional'` for
881
- each: a `locale` that has a pack fetches one lazy file of 416 messages (27 to 39 kB, 7 to 8 kB gzipped; the budget is
882
- 9 kB gzipped), and `mount()` waits for it, so the first paint is already in that language. A `locale` with no pack
952
+ each: a `locale` that has a pack fetches one lazy file of 431 messages (30 to 43 kB, 7.8 to 9.1 kB gzipped; the budget is
953
+ 10 kB gzipped), and `mount()` waits for it, so the first paint is already in that language. A `locale` with no pack
883
954
  (English, `zh-TW`, an unknown tag) downloads nothing and says nothing in the console: the words stay English, while the
884
955
  plural rules and the direction follow `locale` either way. Your `messages` win over the pack, key by key. The packs are
885
956
  machine translations written from the English words (Workflows has no Shopify base to start from) and no native speaker
@@ -1366,11 +1437,12 @@ What is open:
1366
1437
  counts how many went through each block, never who.
1367
1438
  - **Twelve languages, as lazy packs.** The same twelve as the other modules, provisional until a native speaker has read
1368
1439
  them: `supportedLocales` lists them (see "Speaking your visitors' language").
1369
- - **Its events are not typed in the SDK.** The SDK types the events of three modules by name; a fourth typed overload makes
1370
- TypeScript report a mistake against the wrong module, so Workflows is open, like a module the SDK knows nothing about:
1371
- `on` takes any name and a handler is given what the module sent, unchecked. The reasoning is in `src/sdk/loader/ui.ts`.
1372
- The form with one type argument (`mountModule<MyModule>('workflows', ...)`) does not compile for it: give both,
1373
- `mountModule<MyModule, 'workflows'>(...)`. `tests/unit/fixtures/typedEvents.fixture.ts` pins both.
1440
+ - **Typing the module as well takes both type arguments.** The SDK types the events of Workflows (`WorkflowsEvents`)
1441
+ through its map of events alone, with no overload of its own: `mountModule('workflows', ...)` checks the names in `on` and
1442
+ what each handler is given. A fourth overload by name makes TypeScript report a mistake against the wrong module, so there
1443
+ are three, and the form with one type argument (`mountModule<MyModule>('workflows', ...)`) does not compile for Workflows:
1444
+ give both, `mountModule<MyModule, 'workflows'>(...)`. The reasoning is in `src/sdk/loader/ui.ts`;
1445
+ `tests/unit/fixtures/typedEvents.fixture.ts` pins what compiles and what does not.
1374
1446
  - **The end-to-end tests cannot make the screen fail.** A part of the screen that cannot be drawn (`RENDER_FAILED`, the
1375
1447
  "Try again" button) is covered by the module's unit tests and the package's, not by a browser test, because a page has
1376
1448
  no way to make a Svelte component throw.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/ui-sdk",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Framework-agnostic UI components for building Widgetic integrations",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "main": "dist/index.cjs",