@contentstack/studio-core 1.1.8 → 1.2.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.d.ts CHANGED
@@ -56,9 +56,12 @@ declare let lightSdk: ComposableStudioLightSdk | null;
56
56
  *
57
57
  * const sdk = studioSdk.init({ stackSdk: stack });
58
58
  *
59
- * function MyComponent() {
60
- * const { specOptions } = sdk.fetchComposition({
61
- * composableUid: 'your-composition-uid',
59
+ * // Server-side fetch — note: method is `fetchCompositionData` (not
60
+ * // `fetchComposition`), and it returns the resolved spec options object
61
+ * // directly (NOT wrapped in `{ specOptions }`).
62
+ * async function MyServerPage() {
63
+ * const specOptions = await sdk.fetchCompositionData({
64
+ * compositionUid: 'your-composition-uid',
62
65
  * searchQuery: window.location.search,
63
66
  * });
64
67
  *
@@ -67,10 +70,14 @@ declare let lightSdk: ComposableStudioLightSdk | null;
67
70
  * ```
68
71
  *
69
72
  * @returns {StudioSdk['public']} The public SDK interface for interacting with Studio.
73
+ * Note: this is the public interface DIRECTLY — there is no `.public`
74
+ * namespace on the returned object. Call `sdk.fetchCompositionData(...)`,
75
+ * not `sdk.public.fetchCompositionData(...)`.
70
76
  */
71
77
  declare const studioSdk: {
72
78
  init(userConfig: UserConfig): {
73
79
  fetchCompositionData: (queryOptions: _contentstack_studio_client.CompositionQueryForSSRInput, options?: _contentstack_studio_client.CompositionQueryOptions) => Promise<_contentstack_studio_client.StudioComponentSpecOptions>;
80
+ fetchComposition: (queryOptions: _contentstack_studio_client.CompositionQueryForSSRInput, options?: _contentstack_studio_client.CompositionQueryOptions) => Promise<_contentstack_studio_client.StudioSpec>;
74
81
  getConfig: () => Pick<_contentstack_studio_client.Config, "contentTypeUid" | "cslp" | "openInStudioButton">;
75
82
  };
76
83
  };
@@ -80,4 +87,7 @@ declare function lightInit(userConfig?: LightConfig): {
80
87
  };
81
88
  } | null;
82
89
 
83
- export { Button, extractStyles, handleNodeStyles, lightInit, lightSdk, sdk, studioSdk };
90
+ declare const EDIT_COMPOSITION_LABEL = "Edit Composition";
91
+ declare const EDIT_SECTIONS_LABEL = "Edit Sections";
92
+
93
+ export { Button, EDIT_COMPOSITION_LABEL, EDIT_SECTIONS_LABEL, extractStyles, handleNodeStyles, lightInit, lightSdk, sdk, studioSdk };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC"}
package/dist/index.js CHANGED
@@ -2,4 +2,9 @@ export { Button } from './internal-components/Button.js';
2
2
  export { extractStyles } from './style-extractor/extract-styles.js';
3
3
  export { handleNodeStyles } from './utils/handle-responsive-styles.util.js';
4
4
  export { lightInit, lightSdk, sdk, studioSdk } from './sdk/index.js';
5
+
6
+ const EDIT_COMPOSITION_LABEL = "Edit Composition";
7
+ const EDIT_SECTIONS_LABEL = "Edit Sections";
8
+
9
+ export { EDIT_COMPOSITION_LABEL, EDIT_SECTIONS_LABEL };
5
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AACO,MAAM,sBAAsB,GAAG;AAC/B,MAAM,mBAAmB,GAAG;;;;"}
@@ -33,9 +33,12 @@ export declare let lightSdk: ComposableStudioLightSdk | null;
33
33
  *
34
34
  * const sdk = studioSdk.init({ stackSdk: stack });
35
35
  *
36
- * function MyComponent() {
37
- * const { specOptions } = sdk.fetchComposition({
38
- * composableUid: 'your-composition-uid',
36
+ * // Server-side fetch — note: method is `fetchCompositionData` (not
37
+ * // `fetchComposition`), and it returns the resolved spec options object
38
+ * // directly (NOT wrapped in `{ specOptions }`).
39
+ * async function MyServerPage() {
40
+ * const specOptions = await sdk.fetchCompositionData({
41
+ * compositionUid: 'your-composition-uid',
39
42
  * searchQuery: window.location.search,
40
43
  * });
41
44
  *
@@ -44,10 +47,14 @@ export declare let lightSdk: ComposableStudioLightSdk | null;
44
47
  * ```
45
48
  *
46
49
  * @returns {StudioSdk['public']} The public SDK interface for interacting with Studio.
50
+ * Note: this is the public interface DIRECTLY — there is no `.public`
51
+ * namespace on the returned object. Call `sdk.fetchCompositionData(...)`,
52
+ * not `sdk.public.fetchCompositionData(...)`.
47
53
  */
48
54
  export declare const studioSdk: {
49
55
  init(userConfig: UserConfig): {
50
56
  fetchCompositionData: (queryOptions: import("@contentstack/studio-client").CompositionQueryForSSRInput, options?: import("@contentstack/studio-client").CompositionQueryOptions) => Promise<import("@contentstack/studio-client").StudioComponentSpecOptions>;
57
+ fetchComposition: (queryOptions: import("@contentstack/studio-client").CompositionQueryForSSRInput, options?: import("@contentstack/studio-client").CompositionQueryOptions) => Promise<import("@contentstack/studio-client").StudioSpec>;
51
58
  getConfig: () => Pick<import("@contentstack/studio-client").Config, "contentTypeUid" | "cslp" | "openInStudioButton">;
52
59
  };
53
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAkC,EAChC,UAAU,EACV,SAAS,EACT,WAAW,EACX,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAErC,eAAO,IAAI,GAAG,EAAE,SAAS,GAAG,IAAW,CAAC;AACxC,eAAO,IAAI,QAAQ,EAAE,wBAAwB,GAAG,IAAW,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,SAAS;qBACH,UAAU;uHAgBund,CAAC;;;CAPppd,CAAC;AAEF,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,WAAW;;;;SAIjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAkC,EAChC,UAAU,EACV,SAAS,EACT,WAAW,EACX,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAErC,eAAO,IAAI,GAAG,EAAE,SAAS,GAAG,IAAW,CAAC;AACxC,eAAO,IAAI,QAAQ,EAAE,wBAAwB,GAAG,IAAW,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,SAAS;qBACH,UAAU;uHAgBghyB,CAAC;mHAAoJ,CAAC;;;CAPlsyB,CAAC;AAEF,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,WAAW;;;;SAIjD"}
package/dist/sdk/index.js CHANGED
@@ -34,9 +34,12 @@ let lightSdk = null;
34
34
  *
35
35
  * const sdk = studioSdk.init({ stackSdk: stack });
36
36
  *
37
- * function MyComponent() {
38
- * const { specOptions } = sdk.fetchComposition({
39
- * composableUid: 'your-composition-uid',
37
+ * // Server-side fetch — note: method is `fetchCompositionData` (not
38
+ * // `fetchComposition`), and it returns the resolved spec options object
39
+ * // directly (NOT wrapped in `{ specOptions }`).
40
+ * async function MyServerPage() {
41
+ * const specOptions = await sdk.fetchCompositionData({
42
+ * compositionUid: 'your-composition-uid',
40
43
  * searchQuery: window.location.search,
41
44
  * });
42
45
  *
@@ -45,6 +48,9 @@ let lightSdk = null;
45
48
  * ```
46
49
  *
47
50
  * @returns {StudioSdk['public']} The public SDK interface for interacting with Studio.
51
+ * Note: this is the public interface DIRECTLY — there is no `.public`
52
+ * namespace on the returned object. Call `sdk.fetchCompositionData(...)`,
53
+ * not `sdk.public.fetchCompositionData(...)`.
48
54
  */
49
55
  const studioSdk = {
50
56
  init(userConfig) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/sdk/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAOO,IAAI,GAAG,GAAqB;AAC5B,IAAI,QAAQ,GAAoC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CG;AACI,MAAM,SAAS,GAAG;AACvB,IAAA,IAAI,CAAC,UAAsB,EAAA;QACzB,IAAI,GAAG,EAAE;AACP,YAAA,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC;YAC9C,OAAO,GAAG,CAAC,MAAM;QACnB;AAEA,QAAA,GAAG,GAAG,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC;QAChD,OAAO,GAAG,CAAC,MAAM;IACnB,CAAC;;AAGG,SAAU,SAAS,CAAC,UAAwB,EAAA;AAChD,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,IAAI;AAC5B,IAAA,QAAQ,GAAG,yBAAyB,CAAC,SAAS,CAAC,UAAU,CAAC;AAC1D,IAAA,OAAO,QAAQ;AACjB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/sdk/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAOO,IAAI,GAAG,GAAqB;AAC5B,IAAI,QAAQ,GAAoC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDG;AACI,MAAM,SAAS,GAAG;AACvB,IAAA,IAAI,CAAC,UAAsB,EAAA;QACzB,IAAI,GAAG,EAAE;AACP,YAAA,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC;YAC9C,OAAO,GAAG,CAAC,MAAM;QACnB;AAEA,QAAA,GAAG,GAAG,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC;QAChD,OAAO,GAAG,CAAC,MAAM;IACnB,CAAC;;AAGG,SAAU,SAAS,CAAC,UAAwB,EAAA;AAChD,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,IAAI;AAC5B,IAAA,QAAQ,GAAG,yBAAyB,CAAC,SAAS,CAAC,UAAU,CAAC;AAC1D,IAAA,OAAO,QAAQ;AACjB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/studio-core",
3
- "version": "1.1.8",
3
+ "version": "1.2.1",
4
4
  "description": "Provides utility to fetch spec for composable component",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,17 +40,14 @@
40
40
  "tsup": "^8.5.0"
41
41
  },
42
42
  "dependencies": {
43
- "@contentstack/studio-client": "^1.6.0",
44
- "@contentstack/studio-registry": "^1.5.0",
43
+ "@contentstack/studio-client": "^1.7.1",
44
+ "@contentstack/studio-registry": "^1.6.1",
45
45
  "classnames": "^2.5.1",
46
46
  "goober": "^2.1.16"
47
47
  },
48
48
  "peerDependencies": {
49
- "react": ">=16.0.0",
50
- "react-dom": ">=16.0.0"
49
+ "react": "^18.0.0 || ^19.0.0",
50
+ "react-dom": "^18.0.0 || ^19.0.0"
51
51
  },
52
- "publishConfig": {
53
- "access": "public"
54
- },
55
- "gitHead": "1877b45f4a73ffb0c570ea06c197ba95504c014a"
52
+ "gitHead": "27539dc404d9358c9aa334ccbe6cd98e0405c205"
56
53
  }