@storyblok/js 6.3.0 → 6.3.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/api.d.cts +3 -0
- package/dist/bridge.d.cts +1 -0
- package/dist/editable.d.cts +10 -0
- package/dist/index.d.cts +17 -0
- package/dist/types/index.d.cts +58 -0
- package/package.json +15 -8
- /package/dist/{storyblok-js.js → storyblok-js.cjs} +0 -0
package/dist/api.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadBridge: () => Promise<void>;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ISbStoryData, SbInitResult, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokComponentType } from './types';
|
|
2
|
+
export interface StoryblokBridgeEvent {
|
|
3
|
+
action: string;
|
|
4
|
+
storyId: number;
|
|
5
|
+
story: ISbStoryData;
|
|
6
|
+
}
|
|
7
|
+
export declare const useStoryblokBridge: <T extends StoryblokComponentType<string> = any>(id: number, cb: (newStory: ISbStoryData<T>) => void, options?: StoryblokBridgeConfigV2) => void;
|
|
8
|
+
export declare const storyblokInit: (pluginOptions?: SbSDKOptions) => SbInitResult;
|
|
9
|
+
export declare const loadStoryblokBridge: () => Promise<void>;
|
|
10
|
+
export { useStoryblokBridge as registerStoryblokBridge };
|
|
11
|
+
export { default as apiPlugin } from './api';
|
|
12
|
+
export { default as storyblokEditable } from './editable';
|
|
13
|
+
export * from './types';
|
|
14
|
+
export type { BridgeParams } from '@storyblok/preview-bridge';
|
|
15
|
+
export { buildStoryblokImage, renderRichText, splitTableRows } from '@storyblok/richtext';
|
|
16
|
+
export type { SbRichTextDoc, SbRichTextImageOptions, SbRichTextMark, SbRichTextNode, SbRichTextProps, SbRichTextRenderContext, SbRichTextRendererMap, } from '@storyblok/richtext';
|
|
17
|
+
export { default as StoryblokClient } from 'storyblok-js-client';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ISbComponentType, ISbConfig, ISbStoryData, default as StoryblokClient } from 'storyblok-js-client';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
storyblokRegisterEvent: (cb: () => void) => void;
|
|
5
|
+
StoryblokBridge: {
|
|
6
|
+
new (options?: StoryblokBridgeConfigV2): StoryblokBridgeV2;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface SbInitResult {
|
|
11
|
+
storyblokApi?: StoryblokClient;
|
|
12
|
+
}
|
|
13
|
+
export type SbPluginFactory = (options: SbSDKOptions) => any;
|
|
14
|
+
export type SbBlokKeyDataTypes = string | number | object | boolean | undefined;
|
|
15
|
+
export interface SbBlokData extends ISbComponentType<string> {
|
|
16
|
+
[index: string]: SbBlokKeyDataTypes;
|
|
17
|
+
}
|
|
18
|
+
export interface SbSDKOptions {
|
|
19
|
+
bridge?: boolean;
|
|
20
|
+
accessToken?: string;
|
|
21
|
+
use?: any[];
|
|
22
|
+
apiOptions?: ISbConfig;
|
|
23
|
+
bridgeUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ISbEventPayload<S extends ISbComponentType<string> = any> {
|
|
26
|
+
action: 'customEvent' | 'published' | 'input' | 'change' | 'unpublished' | 'enterEditmode';
|
|
27
|
+
event?: string;
|
|
28
|
+
story?: ISbStoryData<S>;
|
|
29
|
+
slug?: string;
|
|
30
|
+
slugChanged?: boolean;
|
|
31
|
+
storyId?: number;
|
|
32
|
+
reload?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface StoryblokBridgeConfigV2 {
|
|
35
|
+
resolveRelations?: string | string[];
|
|
36
|
+
customParent?: string;
|
|
37
|
+
preventClicks?: boolean;
|
|
38
|
+
language?: string;
|
|
39
|
+
resolveLinks?: 'url' | 'story' | '0' | '1' | 'link';
|
|
40
|
+
fallbackLang?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface StoryblokBridgeV2 {
|
|
43
|
+
pingEditor: (event: any) => void;
|
|
44
|
+
isInEditor: () => boolean;
|
|
45
|
+
enterEditmode: () => void;
|
|
46
|
+
on: (event: 'customEvent' | 'published' | 'input' | 'change' | 'unpublished' | 'enterEditmode' | string[], callback: (payload?: ISbEventPayload) => void) => void;
|
|
47
|
+
}
|
|
48
|
+
export type { ArrayFn, AsyncFn, ISbAlternateObject, // previously AlternateObject
|
|
49
|
+
ISbCache, // previously StoryblokCache
|
|
50
|
+
ISbComponentType as StoryblokComponentType, ISbConfig, // previously StoryblokConfig
|
|
51
|
+
ISbContentMangmntAPI, ISbDimensions, ISbError, ISbManagmentApiResult, // previously StoryblokManagmentApiResult
|
|
52
|
+
ISbResponse, ISbResult, // previously StoryblokResult
|
|
53
|
+
ISbSchema, ISbStories, // previously Stories
|
|
54
|
+
ISbStoriesParams, // previously StoriesParams
|
|
55
|
+
ISbStory, // previously Story
|
|
56
|
+
ISbStoryData, // previously StoryData
|
|
57
|
+
ISbStoryParams, // previously StoryParams
|
|
58
|
+
ISbThrottle, ISbThrottledRequest, } from 'storyblok-js-client';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/js",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.3.
|
|
4
|
+
"version": "6.3.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "SDK to integrate Storyblok into your project using JavaScript.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,12 +17,17 @@
|
|
|
17
17
|
"sideEffects": false,
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/storyblok-js.mjs"
|
|
23
|
+
},
|
|
24
|
+
"require": {
|
|
25
|
+
"types": "./dist/index.d.cts",
|
|
26
|
+
"default": "./dist/storyblok-js.cjs"
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
|
-
"main": "./dist/storyblok-js.
|
|
30
|
+
"main": "./dist/storyblok-js.cjs",
|
|
26
31
|
"module": "./dist/storyblok-js.mjs",
|
|
27
32
|
"types": "./dist/index.d.ts",
|
|
28
33
|
"files": [
|
|
@@ -30,8 +35,8 @@
|
|
|
30
35
|
],
|
|
31
36
|
"dependencies": {
|
|
32
37
|
"@storyblok/preview-bridge": "^2.1.6",
|
|
33
|
-
"@storyblok/richtext": "5.2.
|
|
34
|
-
"storyblok-js-client": "7.7.
|
|
38
|
+
"@storyblok/richtext": "5.2.1",
|
|
39
|
+
"storyblok-js-client": "7.7.3"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
42
|
"@tsconfig/recommended": "^1.0.8",
|
|
@@ -43,9 +48,10 @@
|
|
|
43
48
|
"jsdom": "^26.0.0",
|
|
44
49
|
"kolorist": "^1.8.0",
|
|
45
50
|
"pathe": "^2.0.3",
|
|
51
|
+
"publint": "^0.3.22",
|
|
46
52
|
"start-server-and-test": "^2.0.11",
|
|
47
53
|
"typescript": "5.8.3",
|
|
48
|
-
"vite": "^6.3
|
|
54
|
+
"vite": "^6.4.3",
|
|
49
55
|
"vite-plugin-banner": "^0.8.0",
|
|
50
56
|
"vite-plugin-dts": "^4.5.3",
|
|
51
57
|
"vite-plugin-qrcode": "^0.2.4",
|
|
@@ -75,6 +81,7 @@
|
|
|
75
81
|
"cy:playground": "pnpm --filter='./playground/vanilla' dev",
|
|
76
82
|
"lint": "eslint .",
|
|
77
83
|
"lint:fix": "eslint . --fix",
|
|
84
|
+
"publint": "publint .",
|
|
78
85
|
"cy:run": "cypress run",
|
|
79
86
|
"cy:open": "cypress open"
|
|
80
87
|
}
|
|
File without changes
|