@wix/himalaya-cli 0.1101.0 → 0.1103.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.
Files changed (28) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +23 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +34 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/automations-v1/src/index.d.ts +2 -2
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/index.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/index.d.ts +1 -1
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/index.d.ts +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/email-marketing-v1/src/index.d.ts +2 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/rich-content-editor/src/index.d.ts +29 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/workflows-v1/src/index.d.ts +1 -1
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +4 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +30 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-automations.mjs +10 -4
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +5 -2
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +5 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +5 -2
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-email-marketing.mjs +10 -4
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content-editor.mjs +82 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-workflows.mjs +5 -2
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  20. package/dist/cli.mjs +2278 -1146
  21. package/dist/preview-assets.generated.bin +0 -0
  22. package/guides/component-reference.json +30 -1
  23. package/guides/component-reference.md +45 -3
  24. package/guides/importable-sdks.md +1 -0
  25. package/guides/index.json +1 -1
  26. package/guides/sdk-reference.json +45 -8
  27. package/guides/wix-business-context.md +22 -0
  28. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
- import { type WorkerSubtreePolicy } from "@wix/himalaya/core";
1
+ import { type RichContentEditorTool, type WorkerSubtreePolicy } from "@wix/himalaya/core";
2
+ export type { RichContentEditorTool };
2
3
  export interface Component {
3
4
  id: string;
4
5
  body: {
@@ -398,6 +399,27 @@ export declare function richContent(props: {
398
399
  id: string;
399
400
  modifiers?: NonNullable<Component["modifiers"]>;
400
401
  }): Component;
402
+ /**
403
+ * RFC 0063 §6 — RichContentEditor: edits ONE Ricos document (a JSON string) inside the bundled
404
+ * engine page, with a native toolbar. Put it in a Form: its document reaches `submit(s, values)`
405
+ * as `values[name]` (absent when the editor was unavailable — treat the body as unchanged).
406
+ * The id is REQUIRED: the arms derive `<id>/webview`, `<id>/tb_<tool>`, … from it (invariant 27).
407
+ */
408
+ export declare function richContentEditor(props: {
409
+ name: string;
410
+ documentPath?: string;
411
+ documentJson?: string;
412
+ placeholder?: string;
413
+ tools?: RichContentEditorTool[];
414
+ onChange?: ActionShape;
415
+ uploadService?: string;
416
+ fillAvailable?: boolean;
417
+ minHeight?: number;
418
+ fallback?: Component;
419
+ }, opts: {
420
+ id: string;
421
+ modifiers?: NonNullable<Component["modifiers"]>;
422
+ }): Component;
401
423
  export declare function spacer(opts?: {
402
424
  id?: string;
403
425
  value?: string;
@@ -1519,6 +1519,36 @@ export interface DataTableProps {
1519
1519
  maxRows?: number;
1520
1520
  zebra?: boolean;
1521
1521
  }
1522
+ /** RFC 0063 §6 — the toolbar buttons a RichContentEditor may show, in toolbar order. */
1523
+ export declare const RICH_CONTENT_EDITOR_TOOLS: readonly ["bold", "italic", "underline", "heading", "bullet", "ordered", "quote", "link", "image", "divider", "undo", "redo"];
1524
+ export type RichContentEditorTool = (typeof RICH_CONTENT_EDITOR_TOOLS)[number];
1525
+ /**
1526
+ * RFC 0063 §6 — a Form control that edits ONE Wix Ricos document in the bundled, offline Ricos
1527
+ * engine page, driven by a native toolbar. The document travels as a JSON STRING into the Form
1528
+ * bag under `name` (`submit(s, values)` → `values[name]`; ABSENT when the editor never became
1529
+ * ready or is unavailable — then treat the body as unchanged).
1530
+ */
1531
+ export interface RichContentEditorProps {
1532
+ /** Form-bag key. Required inside a Form (validator). */
1533
+ name?: string;
1534
+ /** `$service:<svc>.<path>` → the document JSON string. Seeds ONCE (the first non-empty value). */
1535
+ documentPath?: string;
1536
+ /** Literal seed document JSON. At most one of documentPath / documentJson. */
1537
+ documentJson?: string;
1538
+ placeholder?: string;
1539
+ /** Empty ⇒ all, minus "image" unless uploadService is set. "image" requires uploadService. */
1540
+ tools?: RichContentEditorTool[];
1541
+ /** Debounced ≥ 500 ms; args = { dirty: "true" } — never the document. */
1542
+ onChange?: Action;
1543
+ /** Worker service made by `ricosUploadService` (@himalaya/wix-rich-content-editor). Enables "image". */
1544
+ uploadService?: string;
1545
+ /** Take the remaining height of a bounded parent; else `minHeight`. */
1546
+ fillAvailable?: boolean;
1547
+ /** Default 240. */
1548
+ minHeight?: number;
1549
+ /** Rendered when the engine page is unavailable (not bundled / missing / failed / 15 s timeout). */
1550
+ fallback?: Component;
1551
+ }
1522
1552
  /**
1523
1553
  * RFC 0063 — a Wix Ricos rich-content document rendered natively: headings, lists, links,
1524
1554
  * images, galleries, video, tables and link cards (never a WebView). The document travels as a
@@ -2345,6 +2375,10 @@ export type CoreComponentBody = {
2345
2375
  package: "himalaya";
2346
2376
  type: "RichContent";
2347
2377
  props: RichContentProps;
2378
+ } | {
2379
+ package: "himalaya";
2380
+ type: "RichContentEditor";
2381
+ props: RichContentEditorProps;
2348
2382
  } | {
2349
2383
  package: "himalaya";
2350
2384
  type: "VoiceNote";
@@ -1016,7 +1016,7 @@ export interface WixGenerateActionInputMappingFromTemplateOptions {
1016
1016
  actionKey?: string;
1017
1017
  actionInputMappingTemplate?: Record<string, unknown>;
1018
1018
  }
1019
- export declare function getAutomationRevision(automationId: string, opts?: WixCallOptions): Promise<WixGetAutomationRevisionResponse>;
1019
+ export declare function getAutomationRevision(automationId: string, req?: Omit<WixGetAutomationRevisionRequest, "automationId">, opts?: WixCallOptions): Promise<WixGetAutomationRevisionResponse>;
1020
1020
  export declare function createAutomation(req?: WixCreateAutomationRequest, opts?: WixCallOptions): Promise<WixCreateAutomationResponse>;
1021
1021
  export declare function createAutomationFromTemplateId(automationTemplateId: string, req?: WixCreateAutomationFromTemplateIdRequest, opts?: WixCallOptions): Promise<WixCreateAutomationFromTemplateIdResponse>;
1022
1022
  export declare function getAutomation(automationId: string, opts?: WixCallOptions): Promise<WixGetAutomationResponse>;
@@ -1040,7 +1040,7 @@ export declare function generateActionInputMappingFromTemplate(req?: WixGenerate
1040
1040
  export declare function bulkDeleteAutomations(req?: WixBulkDeleteAutomationsRequest, opts?: WixCallOptions): Promise<WixBulkDeleteAutomationsResponse>;
1041
1041
  export declare function createPreinstalledAutomation(req?: WixCreatePreinstalledAutomationRequest, opts?: WixCallOptions): Promise<WixCreatePreinstalledAutomationResponse>;
1042
1042
  export declare function updatePreinstalledAutomation(req?: WixUpdatePreinstalledAutomationRequest, opts?: WixCallOptions): Promise<WixUpdatePreinstalledAutomationResponse>;
1043
- export declare function deletePreinstalledAutomation(componentId: string, opts?: WixCallOptions): Promise<WixDeletePreinstalledAutomationResponse>;
1043
+ export declare function deletePreinstalledAutomation(componentId: string, req?: Omit<WixDeletePreinstalledAutomationRequest, "componentId">, opts?: WixCallOptions): Promise<WixDeletePreinstalledAutomationResponse>;
1044
1044
  export declare function generatePreinstalledAutomation(req?: WixGeneratePreinstalledAutomationRequest, opts?: WixCallOptions): Promise<WixGeneratePreinstalledAutomationResponse>;
1045
1045
  export declare function queryPreinstalledAutomationsForApp(req?: WixQueryPreinstalledAutomationsForAppRequest, opts?: WixCallOptions): Promise<WixQueryPreinstalledAutomationsForAppResponse>;
1046
1046
  export declare function queryPreinstalledAutomations(req?: WixQueryPreinstalledAutomationsRequest, opts?: WixCallOptions): Promise<WixQueryPreinstalledAutomationsResponse>;
@@ -270,7 +270,7 @@ export declare function query(req?: WixQueryRequest, opts?: WixCallOptions): Pro
270
270
  export declare function get(id: string, opts?: WixCallOptions): Promise<WixGetResponse>;
271
271
  export declare function count(req?: WixCountRequest, opts?: WixCallOptions): Promise<WixCountResponse>;
272
272
  export declare function assignBadge(id: string, req?: WixAssignBadgeRequest, opts?: WixCallOptions): Promise<WixAssignBadgeResponse>;
273
- export declare function unassignBadge(id: string, opts?: WixCallOptions): Promise<WixUnassignBadgeResponse>;
273
+ export declare function unassignBadge(id: string, req?: Omit<WixUnassignBadgeRequest, "id">, opts?: WixCallOptions): Promise<WixUnassignBadgeResponse>;
274
274
  export declare function listMembers(id: string, opts?: WixCallOptions): Promise<WixListMembersResponse>;
275
275
  export declare function listMembersBadgeIds(req?: WixListMembersBadgeIdsRequest, opts?: WixCallOptions): Promise<WixListMembersBadgeIdsResponse>;
276
276
  export declare function getBadgeCounters(req?: WixGetBadgeCountersRequest, opts?: WixCallOptions): Promise<WixGetBadgeCountersResponse>;
@@ -1687,7 +1687,7 @@ export declare function hideComment(commentId: string, req?: WixHideCommentReque
1687
1687
  export declare function publishComment(commentId: string, req?: WixPublishCommentRequest, opts?: WixCallOptions): Promise<WixPublishCommentResponse>;
1688
1688
  export declare function countComments(req?: WixCountCommentsRequest, opts?: WixCallOptions): Promise<WixCountCommentsResponse>;
1689
1689
  export declare function listCommentsByResource(req?: WixListCommentsByResourceRequest, opts?: WixCallOptions): Promise<WixListCommentsByResourceResponse>;
1690
- export declare function getCommentThread(commentId: string, opts?: WixCallOptions): Promise<WixGetCommentThreadResponse>;
1690
+ export declare function getCommentThread(commentId: string, req?: Omit<WixGetCommentThreadRequest, "commentId">, opts?: WixCallOptions): Promise<WixGetCommentThreadResponse>;
1691
1691
  /**
1692
1692
  * Adds the current identity's reaction to a comment.
1693
1693
  *
@@ -1167,7 +1167,7 @@ export interface WixUpdateSpecialPermissions {
1167
1167
  itemUpdate?: string;
1168
1168
  itemRemove?: string;
1169
1169
  }
1170
- export declare function getDataCollection(dataCollectionId: string, opts?: WixCallOptions): Promise<WixGetDataCollectionResponse>;
1170
+ export declare function getDataCollection(dataCollectionId: string, req?: Omit<WixGetDataCollectionRequest, "dataCollectionId">, opts?: WixCallOptions): Promise<WixGetDataCollectionResponse>;
1171
1171
  export declare function listDataCollections(req?: WixListDataCollectionsRequest, opts?: WixCallOptions): Promise<WixListDataCollectionsResponse>;
1172
1172
  export declare function deleteDataCollection(dataCollectionId: string, opts?: WixCallOptions): Promise<WixDeleteDataCollectionResponse>;
1173
1173
  export declare function restoreDataCollection(dataCollectionId: string, req?: WixRestoreDataCollectionRequest, opts?: WixCallOptions): Promise<WixRestoreDataCollectionResponse>;
@@ -786,7 +786,7 @@ export interface WixUpdateResponse {
786
786
  export interface WixVerifyEmailResponse {
787
787
  }
788
788
  export declare function listStatistics(req?: WixListStatisticsRequest, opts?: WixCallOptions): Promise<WixListStatisticsResponse>;
789
- export declare function listRecipients(campaignId: string, opts?: WixCallOptions): Promise<WixListRecipientsResponse>;
789
+ export declare function listRecipients(campaignId: string, req?: Omit<WixListRecipientsRequest, "campaignId">, opts?: WixCallOptions): Promise<WixListRecipientsResponse>;
790
790
  export declare function get(campaignId: string, opts?: WixCallOptions): Promise<WixCampaign>;
791
791
  export declare function list(opts?: WixCallOptions): Promise<WixCampaign>;
792
792
  export declare function publish(campaignId: string, opts?: WixCallOptions): Promise<WixCampaign>;
@@ -824,7 +824,7 @@ export declare function deleteCampaign(campaignId: string, opts?: WixCallOptions
824
824
  *
825
825
  * GET /email-marketing/v1/campaigns/{campaignId}
826
826
  */
827
- export declare function getCampaign(campaignId: string, opts?: WixCallOptions): Promise<WixGetCampaignResponse>;
827
+ export declare function getCampaign(campaignId: string, req?: Omit<WixGetCampaignRequest, "campaignId">, opts?: WixCallOptions): Promise<WixGetCampaignResponse>;
828
828
  /**
829
829
  * Retrieves a campaign's editor data, including the content and subject line.
830
830
  *
@@ -0,0 +1,29 @@
1
+ export declare const DEFAULT_MAX_UPLOAD_BYTES: number;
2
+ export type RicosUploadError = "bad_request" | "unsupported_type" | "too_large" | "upload_url_failed";
3
+ export type RicosUploadEntry = {
4
+ status: "ready";
5
+ uploadUrl: string;
6
+ } | {
7
+ status: "error";
8
+ error: RicosUploadError;
9
+ };
10
+ export interface RicosUploadState {
11
+ uploads: Record<string, RicosUploadEntry>;
12
+ maxBytes: number;
13
+ }
14
+ /** A worker service named `name` with two actions the RichContentEditor arm dispatches:
15
+ * `genUpload({requestId, mimeType, fileName, sizeBytes?})` → `state.uploads[requestId]`, and
16
+ * `clearUpload({requestId})`. Errors are reason codes, never server messages. */
17
+ export declare function ricosUploadService(name: string, opts?: {
18
+ maxBytes?: number;
19
+ }): import("@wix/himalaya/state").ServiceHandle<RicosUploadState> & {
20
+ genUpload: (a?: {
21
+ requestId?: unknown;
22
+ mimeType?: unknown;
23
+ fileName?: unknown;
24
+ sizeBytes?: unknown;
25
+ }) => Promise<RicosUploadState>;
26
+ clearUpload: (a?: {
27
+ requestId?: unknown;
28
+ }) => Promise<RicosUploadState>;
29
+ };
@@ -152,7 +152,7 @@ export interface WixListWorkflowsOptions {
152
152
  sort?: string[];
153
153
  }
154
154
  export declare function listWorkflows(req?: WixListWorkflowsRequest, opts?: WixCallOptions): Promise<WixListWorkflowsResponse>;
155
- export declare function getWorkflow(id: string, opts?: WixCallOptions): Promise<WixGetWorkflowResponse>;
155
+ export declare function getWorkflow(id: string, req?: Omit<WixGetWorkflowRequest, "id">, opts?: WixCallOptions): Promise<WixGetWorkflowResponse>;
156
156
  export declare function updateWorkflow(id: string, req?: WixUpdateWorkflowRequest, opts?: WixCallOptions): Promise<WixUpdateWorkflowResponse>;
157
157
  export declare function createWorkflow(req?: WixCreateWorkflowRequest, opts?: WixCallOptions): Promise<WixCreateWorkflowResponse>;
158
158
  export declare function deleteWorkflow(id: string, opts?: WixCallOptions): Promise<WixDeleteWorkflowResponse>;
@@ -6883,6 +6883,7 @@ var require_dist = __commonJS({
6883
6883
  });
6884
6884
 
6885
6885
  // ../../core/ts/src/schema.ts
6886
+ var RICH_CONTENT_EDITOR_TOOLS = ["bold", "italic", "underline", "heading", "bullet", "ordered", "quote", "link", "image", "divider", "undo", "redo"];
6886
6887
  function resolveTabBarPresentation(raw) {
6887
6888
  return raw === "kit" ? "kit" : "native";
6888
6889
  }
@@ -8712,6 +8713,8 @@ var CORE_COMPONENTS = /* @__PURE__ */ new Set([
8712
8713
  "himalaya.DataTable",
8713
8714
  // Rich content — RFC 0063
8714
8715
  "himalaya.RichContent",
8716
+ // Rich content editor — RFC 0063 §6
8717
+ "himalaya.RichContentEditor",
8715
8718
  // Recorded-audio bubble — messenger design G4
8716
8719
  "himalaya.VoiceNote",
8717
8720
  "himalaya.Marquee",
@@ -13313,6 +13316,7 @@ export {
13313
13316
  PREVIEW_EXEMPT_PLATFORM_KEYS,
13314
13317
  PREVIEW_SURFACES,
13315
13318
  PROJECTION_SNAPSHOT_SIZE,
13319
+ RICH_CONTENT_EDITOR_TOOLS,
13316
13320
  RTL_LOCALES,
13317
13321
  SITE_PAGE_SCREEN_ID,
13318
13322
  SITE_SCREEN_PREFIX,
@@ -6882,6 +6882,9 @@ var require_dist = __commonJS({
6882
6882
  }
6883
6883
  });
6884
6884
 
6885
+ // ../../core/ts/src/schema.ts
6886
+ var RICH_CONTENT_EDITOR_TOOLS = ["bold", "italic", "underline", "heading", "bullet", "ordered", "quote", "link", "image", "divider", "undo", "redo"];
6887
+
6885
6888
  // ../../core/data-resources/src/schema.ts
6886
6889
  var KV_DEFAULT_MAX_VALUE_BYTES = 64 * 1024;
6887
6890
  var KV_MAX_VALUE_BYTES = 256 * 1024;
@@ -8612,6 +8615,32 @@ function richContent(props, opts) {
8612
8615
  const node = { id: opts.id, body: { package: "himalaya", type: "RichContent", props } };
8613
8616
  return opts.modifiers ? withModifiers(node, opts.modifiers) : node;
8614
8617
  }
8618
+ var EDITOR_SERVICE = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
8619
+ function richContentEditor(props, opts) {
8620
+ if (!opts?.id) throw new Error("richContentEditor: an explicit id is required \u2014 its test ids are `<id>/webview`, `<id>/tb_<tool>`, \u2026 (invariant 27)");
8621
+ if (!props.name) throw new Error("richContentEditor: name is required \u2014 it is the Form value key submit(s, values) receives the document under");
8622
+ if (props.documentPath !== void 0 && props.documentJson !== void 0) throw new Error("richContentEditor: pass at most one of documentPath and documentJson");
8623
+ if (props.documentPath !== void 0 && !props.documentPath.startsWith("$service:")) {
8624
+ throw new Error(`richContentEditor: documentPath must be a "$service:" binding, got "${props.documentPath}"`);
8625
+ }
8626
+ if (props.documentJson !== void 0) {
8627
+ let doc;
8628
+ try {
8629
+ doc = JSON.parse(props.documentJson);
8630
+ } catch {
8631
+ doc = void 0;
8632
+ }
8633
+ if (!doc || typeof doc !== "object" || Array.isArray(doc)) throw new Error("richContentEditor: documentJson is not a JSON object");
8634
+ }
8635
+ const unknown = (props.tools ?? []).filter((t) => !RICH_CONTENT_EDITOR_TOOLS.includes(t));
8636
+ if (unknown.length) throw new Error(`richContentEditor: unknown tool(s): ${unknown.join(", ")}`);
8637
+ if (props.tools?.includes("image") && !props.uploadService) throw new Error('richContentEditor: tools includes "image" but no uploadService is set');
8638
+ if (props.uploadService !== void 0 && !EDITOR_SERVICE.test(props.uploadService)) {
8639
+ throw new Error(`richContentEditor: uploadService must name a worker service, got "${props.uploadService}"`);
8640
+ }
8641
+ const node = { id: opts.id, body: { package: "himalaya", type: "RichContentEditor", props } };
8642
+ return opts.modifiers ? withModifiers(node, opts.modifiers) : node;
8643
+ }
8615
8644
  function spacer(opts) {
8616
8645
  const props = {};
8617
8646
  if (opts?.value !== void 0) props.value = opts.value;
@@ -9153,6 +9182,7 @@ export {
9153
9182
  progressBar,
9154
9183
  rating,
9155
9184
  richContent,
9185
+ richContentEditor,
9156
9186
  richText,
9157
9187
  richTextField,
9158
9188
  rive,
@@ -48,12 +48,15 @@ function wixQueryPath(path, req) {
48
48
  add(key, value);
49
49
  return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
50
50
  }
51
- function getAutomationRevision(automationId, opts) {
51
+ function getAutomationRevision(automationId, req, opts) {
52
52
  if (!automationId)
53
53
  throw new Error("getAutomationRevision: automationId is required");
54
54
  return wixCall(
55
55
  "GET",
56
- `/automations/v1/automation-revisions/${encodeURIComponent(automationId)}`,
56
+ wixQueryPath(
57
+ `/automations/v1/automation-revisions/${encodeURIComponent(automationId)}`,
58
+ { ...req, automationId: void 0 }
59
+ ),
57
60
  void 0,
58
61
  opts
59
62
  );
@@ -269,12 +272,15 @@ function updatePreinstalledAutomation(req = {}, opts) {
269
272
  opts
270
273
  );
271
274
  }
272
- function deletePreinstalledAutomation(componentId, opts) {
275
+ function deletePreinstalledAutomation(componentId, req, opts) {
273
276
  if (!componentId)
274
277
  throw new Error("deletePreinstalledAutomation: componentId is required");
275
278
  return wixCall(
276
279
  "DELETE",
277
- `/automations/v2/preinstalled-automation/${encodeURIComponent(componentId)}`,
280
+ wixQueryPath(
281
+ `/automations/v2/preinstalled-automation/${encodeURIComponent(componentId)}`,
282
+ { ...req, componentId: void 0 }
283
+ ),
278
284
  void 0,
279
285
  opts
280
286
  );
@@ -94,11 +94,14 @@ function assignBadge(id, req = {}, opts) {
94
94
  opts
95
95
  );
96
96
  }
97
- function unassignBadge(id, opts) {
97
+ function unassignBadge(id, req, opts) {
98
98
  if (!id) throw new Error("unassignBadge: id is required");
99
99
  return wixCall(
100
100
  "DELETE",
101
- `/badges/v4/badges/${encodeURIComponent(id)}/members`,
101
+ wixQueryPath(`/badges/v4/badges/${encodeURIComponent(id)}/members`, {
102
+ ...req,
103
+ id: void 0
104
+ }),
102
105
  void 0,
103
106
  opts
104
107
  );
@@ -234,11 +234,14 @@ function listCommentsByResource(req = {}, opts) {
234
234
  opts
235
235
  );
236
236
  }
237
- function getCommentThread(commentId, opts) {
237
+ function getCommentThread(commentId, req, opts) {
238
238
  if (!commentId) throw new Error("getCommentThread: commentId is required");
239
239
  return wixCall(
240
240
  "GET",
241
- `/comments/v1/comments/${encodeURIComponent(commentId)}/thread`,
241
+ wixQueryPath(
242
+ `/comments/v1/comments/${encodeURIComponent(commentId)}/thread`,
243
+ { ...req, commentId: void 0 }
244
+ ),
242
245
  void 0,
243
246
  opts
244
247
  );
@@ -62,12 +62,15 @@ function wixQueryPath(path, req) {
62
62
  add(key, value);
63
63
  return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
64
64
  }
65
- function getDataCollection(dataCollectionId, opts) {
65
+ function getDataCollection(dataCollectionId, req, opts) {
66
66
  if (!dataCollectionId)
67
67
  throw new Error("getDataCollection: dataCollectionId is required");
68
68
  return wixCall(
69
69
  "GET",
70
- `/data/v2/collections/${encodeURIComponent(dataCollectionId)}`,
70
+ wixQueryPath(
71
+ `/data/v2/collections/${encodeURIComponent(dataCollectionId)}`,
72
+ { ...req, dataCollectionId: void 0 }
73
+ ),
71
74
  void 0,
72
75
  opts
73
76
  );
@@ -56,11 +56,14 @@ function listStatistics(req = {}, opts) {
56
56
  opts
57
57
  );
58
58
  }
59
- function listRecipients(campaignId, opts) {
59
+ function listRecipients(campaignId, req, opts) {
60
60
  if (!campaignId) throw new Error("listRecipients: campaignId is required");
61
61
  return wixCall(
62
62
  "GET",
63
- `/email-marketing/v1/campaigns/${encodeURIComponent(campaignId)}/statistics/recipients`,
63
+ wixQueryPath(
64
+ `/email-marketing/v1/campaigns/${encodeURIComponent(campaignId)}/statistics/recipients`,
65
+ { ...req, campaignId: void 0 }
66
+ ),
64
67
  void 0,
65
68
  opts
66
69
  );
@@ -153,11 +156,14 @@ function deleteCampaign(campaignId, opts) {
153
156
  opts
154
157
  );
155
158
  }
156
- function getCampaign(campaignId, opts) {
159
+ function getCampaign(campaignId, req, opts) {
157
160
  if (!campaignId) throw new Error("getCampaign: campaignId is required");
158
161
  return wixCall(
159
162
  "GET",
160
- `/email-marketing/v1/campaigns/${encodeURIComponent(campaignId)}`,
163
+ wixQueryPath(
164
+ `/email-marketing/v1/campaigns/${encodeURIComponent(campaignId)}`,
165
+ { ...req, campaignId: void 0 }
166
+ ),
161
167
  void 0,
162
168
  opts
163
169
  );
@@ -0,0 +1,82 @@
1
+ // ../../core/sdk/state/src/index.ts
2
+ function defineService(name, def) {
3
+ const himalaya = globalThis.himalaya;
4
+ if (!himalaya) {
5
+ throw new Error(
6
+ "@himalaya/state: defineService called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5)."
7
+ );
8
+ }
9
+ return himalaya.defineService(name, def);
10
+ }
11
+
12
+ // ../../stdlib/wix-sdk/site-media/src/index.ts
13
+ function wixCall(method, path, body) {
14
+ if (!globalThis.himalaya?.wixApi) {
15
+ return Promise.reject(
16
+ new Error("@himalaya/wix-site-media: host did not install the wixApi bridge")
17
+ );
18
+ }
19
+ return globalThis.himalaya.wixApi.call(method, path, body);
20
+ }
21
+ function generateUploadUrl(mimeType, fileName, parentFolderId) {
22
+ if (!mimeType) throw new Error("generateUploadUrl: mimeType is required");
23
+ if (!fileName) throw new Error("generateUploadUrl: fileName is required");
24
+ const body = { mimeType, fileName };
25
+ if (parentFolderId) body.parentFolderId = parentFolderId;
26
+ return wixCall("POST", "/site-media/v1/files/generate-upload-url", body);
27
+ }
28
+
29
+ // ../../stdlib/wix-sdk/rich-content-editor/src/index.ts
30
+ var DEFAULT_MAX_UPLOAD_BYTES = 25 * 1024 * 1024;
31
+ var REQUEST_ID = /^[A-Za-z0-9_-]{1,64}$/;
32
+ var IMAGE_MIME = /^image\/[a-z0-9.+-]+$/i;
33
+ function ricosUploadService(name, opts = {}) {
34
+ const maxBytes = opts.maxBytes ?? DEFAULT_MAX_UPLOAD_BYTES;
35
+ const put = (requestId, entry) => {
36
+ const now = handle.getState();
37
+ return { ...now, uploads: { ...now.uploads, [requestId]: entry } };
38
+ };
39
+ const inFlight = /* @__PURE__ */ new Set();
40
+ const abandoned = /* @__PURE__ */ new Set();
41
+ const settle = (requestId, entry) => {
42
+ inFlight.delete(requestId);
43
+ if (abandoned.delete(requestId)) return handle.getState();
44
+ return put(requestId, entry);
45
+ };
46
+ const handle = defineService(name, {
47
+ state: { uploads: {}, maxBytes },
48
+ actions: {
49
+ genUpload: async (s, a) => {
50
+ const requestId = typeof a?.requestId === "string" && REQUEST_ID.test(a.requestId) ? a.requestId : null;
51
+ if (!requestId) return s;
52
+ const mimeType = typeof a?.mimeType === "string" ? a.mimeType : "";
53
+ const fileName = typeof a?.fileName === "string" && a.fileName.trim() ? a.fileName.trim().slice(0, 200) : "image";
54
+ if (!IMAGE_MIME.test(mimeType)) return put(requestId, { status: "error", error: "unsupported_type" });
55
+ const size = typeof a?.sizeBytes === "number" ? a.sizeBytes : typeof a?.sizeBytes === "string" ? Number(a.sizeBytes) : void 0;
56
+ if (size !== void 0 && (!Number.isFinite(size) || size < 0)) return put(requestId, { status: "error", error: "bad_request" });
57
+ if (size !== void 0 && size > maxBytes) return put(requestId, { status: "error", error: "too_large" });
58
+ inFlight.add(requestId);
59
+ try {
60
+ const r = await generateUploadUrl(mimeType, fileName);
61
+ const url = typeof r?.uploadUrl === "string" ? r.uploadUrl : "";
62
+ return settle(requestId, /^https:\/\/\S+$/i.test(url) ? { status: "ready", uploadUrl: url } : { status: "error", error: "upload_url_failed" });
63
+ } catch {
64
+ return settle(requestId, { status: "error", error: "upload_url_failed" });
65
+ }
66
+ },
67
+ clearUpload: (s, a) => {
68
+ const id = typeof a?.requestId === "string" ? a.requestId : "";
69
+ if (inFlight.has(id)) abandoned.add(id);
70
+ if (!Object.prototype.hasOwnProperty.call(s.uploads, id)) return s;
71
+ const { [id]: _gone, ...rest } = s.uploads;
72
+ return { ...s, uploads: rest };
73
+ }
74
+ }
75
+ });
76
+ return handle;
77
+ }
78
+ export {
79
+ DEFAULT_MAX_UPLOAD_BYTES,
80
+ ricosUploadService
81
+ };
82
+ //# sourceMappingURL=wix-rich-content-editor.mjs.map
@@ -56,11 +56,14 @@ function listWorkflows(req = {}, opts) {
56
56
  opts
57
57
  );
58
58
  }
59
- function getWorkflow(id, opts) {
59
+ function getWorkflow(id, req, opts) {
60
60
  if (!id) throw new Error("getWorkflow: id is required");
61
61
  return wixCall(
62
62
  "GET",
63
- `/workflows/v1/workflows/${encodeURIComponent(id)}`,
63
+ wixQueryPath(`/workflows/v1/workflows/${encodeURIComponent(id)}`, {
64
+ ...req,
65
+ id: void 0
66
+ }),
64
67
  void 0,
65
68
  opts
66
69
  );
@@ -438,6 +438,10 @@
438
438
  "types": "./dist/_types/stdlib/wix-sdk/rich-content/src/index.d.ts",
439
439
  "import": "./dist/wix-rich-content.mjs"
440
440
  },
441
+ "./wix-rich-content-editor": {
442
+ "types": "./dist/_types/stdlib/wix-sdk/rich-content-editor/src/index.d.ts",
443
+ "import": "./dist/wix-rich-content-editor.mjs"
444
+ },
441
445
  "./wix-seo": {
442
446
  "types": "./dist/_types/stdlib/wix-sdk/seo-v1/src/index.d.ts",
443
447
  "import": "./dist/wix-seo.mjs"