@contentful/app-sdk 4.72.0 → 4.73.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.
@@ -115,6 +115,16 @@ export interface ExperienceNodeSnapshot {
115
115
  id: string;
116
116
  nodeType: ExperienceNodeType;
117
117
  }
118
+ /**
119
+ * The current Content-tab selection. When a selectable node is selected, linkedEntity identifies
120
+ * the Component or Fragment entity it represents. It is omitted for a cleared selection and node
121
+ * types that do not link to an entity.
122
+ */
123
+ export interface ExperienceSelection {
124
+ nodeId: string | null;
125
+ nodeType?: ExperienceNodeType;
126
+ linkedEntity?: ResourceLink<'Contentful:ComponentType' | 'Contentful:Component' | 'Contentful:Fragment' | 'Contentful:ExperienceFragment'>;
127
+ }
118
128
  /**
119
129
  * One allowed resource for a slot: the Component(s) that may be placed in it. `type` accepts both
120
130
  * the current (`Contentful:ComponentType`) and upcoming canonical (`Contentful:Component`) URN.
@@ -164,14 +174,8 @@ export interface ExperienceNodeAPI {
164
174
  getSlotDescriptor(): Promise<SlotDescriptor | null>;
165
175
  }
166
176
  export interface ExperienceSelectionAPI {
167
- get(): {
168
- nodeId: string | null;
169
- nodeType?: ExperienceNodeType;
170
- };
171
- onChange(cb: (sel: {
172
- nodeId: string | null;
173
- nodeType?: ExperienceNodeType;
174
- }) => void): Unsubscribe;
177
+ get(): ExperienceSelection;
178
+ onChange(cb: (sel: ExperienceSelection) => void): Unsubscribe;
175
179
  set(nodeId: string | null): void;
176
180
  highlight(nodeId: string, opts?: {
177
181
  flash?: boolean;
@@ -16,4 +16,4 @@ export type { SearchQuery, CollectionResponse, CursorBasedCollectionResponse, En
16
16
  export type { DateRangeValidationError, InValidationError, LinkContentTypeValidationError, LinkMimetypeGroupValidationError, NotResolvableValidationError, ProhibitRegexpValidationError, RangeValidationError, RegexpValidationError, RequiredValidationError, SizeValidationError, TypeValidationError, UniqueValidationError, UnknownValidationError, ValidationError, AllowedResourceValidationError, AllowedResourcesValidationError, } from './validation-error';
17
17
  export type { WindowAPI } from './window.types';
18
18
  export type { CMAClient } from './cmaClient.types';
19
- export type { Unsubscribe, ExperienceContext, ExperienceSDK, ResourceLink, EntryBinding, DesignTokenValue, ManualDesignValue, DesignValue, ComponentPropertyDescriptor, SameSpaceContentSource, AllowedResource, DataAssemblyParameterDefinition, DataAssemblyParameterValue, DataAssemblySnapshot, DataAssemblySummary, DataAssemblyParameterAPI, DataAssemblyAPI, ExperienceNodeType, ExperienceNodeSnapshot, SlotAllowedResource, SlotDescriptor, ExperienceMetadata, ExperienceSnapshot, ExperienceSys, ExperienceNodeAPI, ExperienceSelectionAPI, ExperienceAPI, } from './experience.types';
19
+ export type { Unsubscribe, ExperienceContext, ExperienceSDK, ResourceLink, EntryBinding, DesignTokenValue, ManualDesignValue, DesignValue, ComponentPropertyDescriptor, SameSpaceContentSource, AllowedResource, DataAssemblyParameterDefinition, DataAssemblyParameterValue, DataAssemblySnapshot, DataAssemblySummary, DataAssemblyParameterAPI, DataAssemblyAPI, ExperienceNodeType, ExperienceNodeSnapshot, ExperienceSelection, SlotAllowedResource, SlotDescriptor, ExperienceMetadata, ExperienceSnapshot, ExperienceSys, ExperienceNodeAPI, ExperienceSelectionAPI, ExperienceAPI, } from './experience.types';
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.72.0","author":"Contentful GmbH","license":"MIT","sideEffects":true,"repository":{"url":"https://github.com/contentful/ui-extensions-sdk.git","type":"git"},"homepage":"https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/","main":"dist/cf-extension-api.js","unpkg":"dist/cf-extension-api.bundled.js","jsdelivr":"dist/cf-extension-api.bundled.js","types":"dist/index.d.ts","files":["dist/cf-extension-api.js","dist/cf-extension-api.js.map","dist/cf-extension-api.bundled.js","dist/cf-extension.css","dist/**/*.d.ts"],"scripts":{"test":"ts-mocha -p tsconfig.test.json 'test/unit/*.[jt]s' --reporter mocha-multi-reporters --reporter-options configFile=mocha.unit-reporters.json","lint":"eslint '{lib,test}/**/*.{t,j}s'","lint:fix":"npm run lint -- --fix","build":"npm run check-types && rollup -c --compact","build:debug":"npm run build -- --sourcemap","prepublishOnly":"npm run build","size":"echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"","semantic-release":"semantic-release","publish-all":"node ./scripts/publish.js","verify":"node ./scripts/verify.js","check-types":"tsc --noEmit -m commonjs","prepare":"husky","lint-staged":"lint-staged"},"dependencies":{"contentful-management":"^12.3.1"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.0","@semantic-release/changelog":"7.0.0","@semantic-release/exec":"7.1.0","@semantic-release/git":"11.0.1","@testing-library/dom":"10.4.1","@types/chai-as-promised":"8.0.2","@types/cross-spawn":"6.0.6","@types/fs-extra":"11.0.4","@types/jsdom":"30.0.0","@types/mocha":"10.0.10","@types/nanoid":"3.0.0","@types/sinon":"^22.0.0","@types/sinon-chai":"^4.0.0","@typescript-eslint/eslint-plugin":"7.18.0","@typescript-eslint/parser":"7.18.0","babel-eslint":"10.1.0","chai":"4.5.0","chai-as-promised":"8.0.2","cross-spawn":"7.0.6","eslint":"8.57.1","eslint-config-prettier":"10.1.8","eslint-config-standard":"17.1.0","eslint-plugin-import":"2.32.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"5.5.6","eslint-plugin-promise":"6.6.0","eslint-plugin-react":"7.37.5","eslint-plugin-standard":"5.0.0","fs-extra":"11.3.5","husky":"9.1.7","jsdom":"30.0.1","lint-staged":"17.0.8","mocha":"11.7.6","mocha-junit-reporter":"2.2.1","mocha-multi-reporters":"1.5.1","mochawesome":"8.0.1","mochawesome-merge":"5.1.1","mochawesome-report-generator":"6.3.2","prettier":"3.8.4","rollup":"2.80.0","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.37.0","semantic-release":"^25.0.2","sinon":"22.0.0","sinon-chai":"3.7.0","ts-mocha":"11.1.0","tslib":"2.8.1","typescript":"5.9.3"},"lint-staged":{"*.ts":["prettier --write","eslint --fix"],"*.md":["prettier --write"]},"release":{"branches":["main",{"name":"canary","channel":"canary","prerelease":"alpha"}],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog",["@semantic-release/npm",{"npmPublish":false}],["@semantic-release/exec",{"verifyConditionsCmd":"node ./scripts/verify.js","publishCmd":"npm run publish-all"}],["@semantic-release/git",{"message":"chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}","assets":["CHANGELOG.md","package.json","package-lock.json"]}],"@semantic-release/github"]}}
1
+ {"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.73.0","author":"Contentful GmbH","license":"MIT","sideEffects":true,"repository":{"url":"https://github.com/contentful/ui-extensions-sdk.git","type":"git"},"homepage":"https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/","main":"dist/cf-extension-api.js","unpkg":"dist/cf-extension-api.bundled.js","jsdelivr":"dist/cf-extension-api.bundled.js","types":"dist/index.d.ts","files":["dist/cf-extension-api.js","dist/cf-extension-api.js.map","dist/cf-extension-api.bundled.js","dist/cf-extension.css","dist/**/*.d.ts"],"scripts":{"test":"ts-mocha -p tsconfig.test.json 'test/unit/*.[jt]s' --reporter mocha-multi-reporters --reporter-options configFile=mocha.unit-reporters.json","lint":"eslint '{lib,test}/**/*.{t,j}s'","lint:fix":"npm run lint -- --fix","build":"npm run check-types && rollup -c --compact","build:debug":"npm run build -- --sourcemap","prepublishOnly":"npm run build","size":"echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"","semantic-release":"semantic-release","publish-all":"node ./scripts/publish.js","verify":"node ./scripts/verify.js","check-types":"tsc --noEmit -m commonjs","prepare":"husky","lint-staged":"lint-staged"},"dependencies":{"contentful-management":"^12.3.1"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.0","@semantic-release/changelog":"7.0.0","@semantic-release/exec":"7.1.0","@semantic-release/git":"11.0.1","@testing-library/dom":"10.4.1","@types/chai-as-promised":"8.0.2","@types/cross-spawn":"6.0.6","@types/fs-extra":"11.0.4","@types/jsdom":"30.0.0","@types/mocha":"10.0.10","@types/nanoid":"3.0.0","@types/sinon":"^22.0.0","@types/sinon-chai":"^4.0.0","@typescript-eslint/eslint-plugin":"7.18.0","@typescript-eslint/parser":"7.18.0","babel-eslint":"10.1.0","chai":"4.5.0","chai-as-promised":"8.0.2","cross-spawn":"7.0.6","eslint":"8.57.1","eslint-config-prettier":"10.1.8","eslint-config-standard":"17.1.0","eslint-plugin-import":"2.32.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"5.5.6","eslint-plugin-promise":"6.6.0","eslint-plugin-react":"7.37.5","eslint-plugin-standard":"5.0.0","fs-extra":"11.3.5","husky":"9.1.7","jsdom":"30.0.1","lint-staged":"17.0.8","mocha":"11.7.6","mocha-junit-reporter":"2.2.1","mocha-multi-reporters":"1.5.1","mochawesome":"8.0.1","mochawesome-merge":"5.1.1","mochawesome-report-generator":"6.3.2","prettier":"3.8.4","rollup":"2.80.0","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.37.0","semantic-release":"^25.0.2","sinon":"22.0.0","sinon-chai":"3.7.0","ts-mocha":"11.1.0","tslib":"2.8.1","typescript":"5.9.3"},"lint-staged":{"*.ts":["prettier --write","eslint --fix"],"*.md":["prettier --write"]},"release":{"branches":["main",{"name":"canary","channel":"canary","prerelease":"alpha"}],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog",["@semantic-release/npm",{"npmPublish":false}],["@semantic-release/exec",{"verifyConditionsCmd":"node ./scripts/verify.js","publishCmd":"npm run publish-all"}],["@semantic-release/git",{"message":"chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}","assets":["CHANGELOG.md","package.json","package-lock.json"]}],"@semantic-release/github"]}}