@storyblok/js 6.3.4 → 6.4.1

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/index.cjs CHANGED
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  }) : target, mod));
29
29
  //#endregion
30
30
  let storyblok_js_client = require("storyblok-js-client");
31
- storyblok_js_client = __toESM(storyblok_js_client, 1);
31
+ storyblok_js_client = __toESM(storyblok_js_client);
32
32
  let _storyblok_richtext = require("@storyblok/richtext");
33
33
  //#region src/bridge.ts
34
34
  let loaded = false;
@@ -82,6 +82,12 @@ var editable_default = (blok) => {
82
82
  }
83
83
  };
84
84
  //#endregion
85
+ //#region src/editableField.ts
86
+ const fieldAttributeKey = "data-blok-f";
87
+ function editableField(field) {
88
+ return typeof field === "string" && field ? { [fieldAttributeKey]: field } : {};
89
+ }
90
+ //#endregion
85
91
  //#region src/index.ts
86
92
  /**
87
93
  * Normalises StoryblokBridgeConfigV2 options for the bundled
@@ -161,6 +167,7 @@ Object.defineProperty(exports, "buildStoryblokImage", {
161
167
  return _storyblok_richtext.buildStoryblokImage;
162
168
  }
163
169
  });
170
+ exports.editableField = editableField;
164
171
  exports.loadStoryblokBridge = loadStoryblokBridge;
165
172
  exports.registerStoryblokBridge = useStoryblokBridge;
166
173
  exports.useStoryblokBridge = useStoryblokBridge;
package/dist/index.d.cts CHANGED
@@ -5,7 +5,7 @@
5
5
  * author: undefined
6
6
  */
7
7
  import StoryblokClient, { ArrayFn, AsyncFn, ISbAlternateObject, ISbCache, ISbComponentType, ISbComponentType as StoryblokComponentType, ISbConfig, ISbConfig as ISbConfig$1, ISbContentMangmntAPI, ISbDimensions, ISbError, ISbManagmentApiResult, ISbResponse, ISbResult, ISbSchema, ISbStories, ISbStoriesParams, ISbStory, ISbStoryData, ISbStoryData as ISbStoryData$1, ISbStoryParams, ISbThrottle, ISbThrottledRequest, default as StoryblokClient$1 } from "storyblok-js-client";
8
- import { BridgeParams } from "@storyblok/preview-bridge";
8
+ import { BridgeParams, EditableFieldAttributes } from "@storyblok/preview-bridge";
9
9
  import { SbRichTextDoc, SbRichTextImageOptions, SbRichTextMark, SbRichTextNode, SbRichTextProps, SbRichTextRenderContext, SbRichTextRendererMap, buildStoryblokImage, renderRichText, splitTableRows } from "@storyblok/richtext";
10
10
  //#region src/types/index.d.ts
11
11
  declare global {
@@ -69,6 +69,9 @@ declare const _default: (blok?: {
69
69
  "data-blok-uid": string;
70
70
  };
71
71
  //#endregion
72
+ //#region src/editableField.d.ts
73
+ declare function editableField(field: string): EditableFieldAttributes | Record<string, never>;
74
+ //#endregion
72
75
  //#region src/index.d.ts
73
76
  interface StoryblokBridgeEvent {
74
77
  action: string;
@@ -79,4 +82,4 @@ declare const useStoryblokBridge: <T extends StoryblokComponentType<string> = an
79
82
  declare const storyblokInit: (pluginOptions?: SbSDKOptions) => SbInitResult;
80
83
  declare const loadStoryblokBridge: () => Promise<void>;
81
84
  //#endregion
82
- export { type ArrayFn, type AsyncFn, type BridgeParams, type ISbAlternateObject, type ISbCache, type ISbConfig, type ISbContentMangmntAPI, type ISbDimensions, type ISbError, ISbEventPayload, type ISbManagmentApiResult, type ISbResponse, type ISbResult, type ISbSchema, type ISbStories, type ISbStoriesParams, type ISbStory, type ISbStoryData, type ISbStoryParams, type ISbThrottle, type ISbThrottledRequest, SbBlokData, SbBlokKeyDataTypes, SbInitResult, SbPluginFactory, type SbRichTextDoc, type SbRichTextImageOptions, type SbRichTextMark, type SbRichTextNode, type SbRichTextProps, type SbRichTextRenderContext, type SbRichTextRendererMap, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokBridgeEvent, StoryblokBridgeV2, StoryblokClient, type StoryblokComponentType, apiFactory as apiPlugin, buildStoryblokImage, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, _default as storyblokEditable, storyblokInit };
85
+ export { type ArrayFn, type AsyncFn, type BridgeParams, type ISbAlternateObject, type ISbCache, type ISbConfig, type ISbContentMangmntAPI, type ISbDimensions, type ISbError, ISbEventPayload, type ISbManagmentApiResult, type ISbResponse, type ISbResult, type ISbSchema, type ISbStories, type ISbStoriesParams, type ISbStory, type ISbStoryData, type ISbStoryParams, type ISbThrottle, type ISbThrottledRequest, SbBlokData, SbBlokKeyDataTypes, SbInitResult, SbPluginFactory, type SbRichTextDoc, type SbRichTextImageOptions, type SbRichTextMark, type SbRichTextNode, type SbRichTextProps, type SbRichTextRenderContext, type SbRichTextRendererMap, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokBridgeEvent, StoryblokBridgeV2, StoryblokClient, type StoryblokComponentType, apiFactory as apiPlugin, buildStoryblokImage, editableField, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, _default as storyblokEditable, storyblokInit };
package/dist/index.d.mts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import StoryblokClient, { ArrayFn, AsyncFn, ISbAlternateObject, ISbCache, ISbComponentType, ISbComponentType as StoryblokComponentType, ISbConfig, ISbConfig as ISbConfig$1, ISbContentMangmntAPI, ISbDimensions, ISbError, ISbManagmentApiResult, ISbResponse, ISbResult, ISbSchema, ISbStories, ISbStoriesParams, ISbStory, ISbStoryData, ISbStoryData as ISbStoryData$1, ISbStoryParams, ISbThrottle, ISbThrottledRequest, default as StoryblokClient$1 } from "storyblok-js-client";
8
8
  import { SbRichTextDoc, SbRichTextImageOptions, SbRichTextMark, SbRichTextNode, SbRichTextProps, SbRichTextRenderContext, SbRichTextRendererMap, buildStoryblokImage, renderRichText, splitTableRows } from "@storyblok/richtext";
9
- import { BridgeParams } from "@storyblok/preview-bridge";
9
+ import { BridgeParams, EditableFieldAttributes } from "@storyblok/preview-bridge";
10
10
  //#region src/types/index.d.ts
11
11
  declare global {
12
12
  interface Window {
@@ -69,6 +69,9 @@ declare const _default: (blok?: {
69
69
  "data-blok-uid": string;
70
70
  };
71
71
  //#endregion
72
+ //#region src/editableField.d.ts
73
+ declare function editableField(field: string): EditableFieldAttributes | Record<string, never>;
74
+ //#endregion
72
75
  //#region src/index.d.ts
73
76
  interface StoryblokBridgeEvent {
74
77
  action: string;
@@ -79,4 +82,4 @@ declare const useStoryblokBridge: <T extends StoryblokComponentType<string> = an
79
82
  declare const storyblokInit: (pluginOptions?: SbSDKOptions) => SbInitResult;
80
83
  declare const loadStoryblokBridge: () => Promise<void>;
81
84
  //#endregion
82
- export { type ArrayFn, type AsyncFn, type BridgeParams, type ISbAlternateObject, type ISbCache, type ISbConfig, type ISbContentMangmntAPI, type ISbDimensions, type ISbError, ISbEventPayload, type ISbManagmentApiResult, type ISbResponse, type ISbResult, type ISbSchema, type ISbStories, type ISbStoriesParams, type ISbStory, type ISbStoryData, type ISbStoryParams, type ISbThrottle, type ISbThrottledRequest, SbBlokData, SbBlokKeyDataTypes, SbInitResult, SbPluginFactory, type SbRichTextDoc, type SbRichTextImageOptions, type SbRichTextMark, type SbRichTextNode, type SbRichTextProps, type SbRichTextRenderContext, type SbRichTextRendererMap, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokBridgeEvent, StoryblokBridgeV2, StoryblokClient, type StoryblokComponentType, apiFactory as apiPlugin, buildStoryblokImage, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, _default as storyblokEditable, storyblokInit };
85
+ export { type ArrayFn, type AsyncFn, type BridgeParams, type ISbAlternateObject, type ISbCache, type ISbConfig, type ISbContentMangmntAPI, type ISbDimensions, type ISbError, ISbEventPayload, type ISbManagmentApiResult, type ISbResponse, type ISbResult, type ISbSchema, type ISbStories, type ISbStoriesParams, type ISbStory, type ISbStoryData, type ISbStoryParams, type ISbThrottle, type ISbThrottledRequest, SbBlokData, SbBlokKeyDataTypes, SbInitResult, SbPluginFactory, type SbRichTextDoc, type SbRichTextImageOptions, type SbRichTextMark, type SbRichTextNode, type SbRichTextProps, type SbRichTextRenderContext, type SbRichTextRendererMap, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokBridgeEvent, StoryblokBridgeV2, StoryblokClient, type StoryblokComponentType, apiFactory as apiPlugin, buildStoryblokImage, editableField, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, _default as storyblokEditable, storyblokInit };
package/dist/index.mjs CHANGED
@@ -58,6 +58,12 @@ var editable_default = (blok) => {
58
58
  }
59
59
  };
60
60
  //#endregion
61
+ //#region src/editableField.ts
62
+ const fieldAttributeKey = "data-blok-f";
63
+ function editableField(field) {
64
+ return typeof field === "string" && field ? { [fieldAttributeKey]: field } : {};
65
+ }
66
+ //#endregion
61
67
  //#region src/index.ts
62
68
  /**
63
69
  * Normalises StoryblokBridgeConfigV2 options for the bundled
@@ -124,4 +130,4 @@ const storyblokInit = (pluginOptions = {}) => {
124
130
  };
125
131
  const loadStoryblokBridge = () => loadBridge();
126
132
  //#endregion
127
- export { StoryblokClient, apiFactory as apiPlugin, buildStoryblokImage, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, editable_default as storyblokEditable, storyblokInit };
133
+ export { StoryblokClient, apiFactory as apiPlugin, buildStoryblokImage, editableField, loadStoryblokBridge, useStoryblokBridge as registerStoryblokBridge, useStoryblokBridge, renderRichText, splitTableRows, editable_default as storyblokEditable, storyblokInit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/js",
3
- "version": "6.3.4",
3
+ "version": "6.4.1",
4
4
  "private": false,
5
5
  "description": "SDK to integrate Storyblok into your project using JavaScript.",
6
6
  "homepage": "https://github.com/storyblok/monoblok/tree/main/packages/js#readme",
@@ -35,9 +35,9 @@
35
35
  "./package.json": "./package.json"
36
36
  },
37
37
  "dependencies": {
38
- "@storyblok/preview-bridge": "^2.5.0",
39
- "@storyblok/richtext": "^5.3.3",
40
- "storyblok-js-client": "^7.7.7"
38
+ "@storyblok/preview-bridge": "^2.6.0",
39
+ "@storyblok/richtext": "^5.4.0",
40
+ "storyblok-js-client": "^7.8.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@tsconfig/recommended": "^1.0.8",