@cloudscape-design/components 3.0.734 → 3.0.735

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.
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (ca816995)";
2
+ export var PACKAGE_VERSION = "3.0.0 (bce2ba06)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (ca816995)",
3
+ "PACKAGE_VERSION": "3.0.0 (bce2ba06)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "ca816995663057fcb38b2bfb26cb274b97f397d4"
2
+ "commit": "bce2ba067f9ce974dec7ffe6f7f1d3e7bb184b94"
3
3
  }
@@ -11,7 +11,7 @@ export class AppLayoutWidgetController {
11
11
  if (forcedPrimary) {
12
12
  return forcedPrimary;
13
13
  }
14
- for (const registration of __classPrivateFieldGet(this, _AppLayoutWidgetController_registrations, "f").slice().reverse()) {
14
+ for (const registration of __classPrivateFieldGet(this, _AppLayoutWidgetController_registrations, "f").slice()) {
15
15
  if (registration.forceType !== 'secondary') {
16
16
  return registration;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app-layout-widget.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAkCtC,MAAM,OAAO,yBAAyB;IAAtC;QACE,mDAAqD,EAAE,EAAC;QAExD,iDAAe,GAAG,EAAE;YAClB,MAAM,aAAa,GAAG,uBAAA,IAAI,gDAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,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AAgB,EAAE;gBAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;aACxD;YAED,MAAM,YAAY,GAAgC;gBAChD,SAAS;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,KAAK,EAAE,EAAW;gBAClB,iBAAiB,EAAE;oBACjB,IAAI,EAAE,WAAW;oBACjB,MAAM,EAAE,KAAK,CAAC,EAAE;wBACd,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;wBAC3B,uBAAA,IAAI,iDAAgB,MAApB,IAAI,CAAkB,CAAC;oBACzB,CAAC;iBACF;aACF,CAAC;YACF,uBAAA,IAAI,gDAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEvC,uBAAA,IAAI,yCAAQ,MAAZ,IAAI,CAAU,CAAC;YAEf,OAAO,GAAG,EAAE;gBACV,uBAAA,IAAI,gDAAe,CAAC,MAAM,CAAC,uBAAA,IAAI,gDAAe,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;gBACzE,uBAAA,IAAI,iDAAgB,MAApB,IAAI,CAAkB,CAAC;YACzB,CAAC,CAAC;QACJ,CAAC,CAAC;QAEF,uBAAkB,GAAG,GAAG,EAAE;YACxB,OAAO;gBACL,aAAa,EAAE,uBAAA,IAAI,gDAAe;aACnC,CAAC;QACJ,CAAC,CAAC;QAEF,oBAAe,GAAG,CAChB,cAA0D,EAAE,EACzB,EAAE;;YACrC,MAAA,WAAW,CAAC,QAAQ,oCAApB,WAAW,CAAC,QAAQ,GAAK,IAAI,CAAC,QAAQ,EAAC;YACvC,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;YAC3D,OAAO,WAAgD,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;CAAA","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\n\ninterface PrimaryRegistration<Props> {\n type: 'primary';\n discoveredProps: Array<Props>;\n}\n\ninterface SecondaryRegistration<Props> {\n type: 'secondary';\n update: (props: Props) => void;\n}\n\nexport type RegistrationState<Props> = PrimaryRegistration<Props> | SecondaryRegistration<Props>;\nexport type RegistrationType = RegistrationState<unknown>['type'];\n\ntype RegistrationChangeHandler<Props> = (\n registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>\n) => void;\n\ninterface RegistrationInternal<Props> {\n forceType: RegistrationType | undefined;\n props: Props;\n secondaryInstance: SecondaryRegistration<Props>;\n onChange: (registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>) => void;\n}\n\nexport interface AppLayoutWidgetApiInternal<Props = unknown> {\n register(\n forceDeduplicationType: RegistrationType | undefined,\n onPropsChange: RegistrationChangeHandler<Props>\n ): () => void;\n getStateForTesting(): { registrations: Array<RegistrationInternal<Props>> };\n}\n\nexport class AppLayoutWidgetController<Props = unknown> {\n #registrations: Array<RegistrationInternal<Props>> = [];\n\n #findPrimary = () => {\n const forcedPrimary = this.#registrations.find(registration => registration.forceType === 'primary');\n if (forcedPrimary) {\n return forcedPrimary;\n }\n for (const registration of this.#registrations.slice().reverse()) {\n if (registration.forceType !== 'secondary') {\n return registration;\n }\n }\n return undefined;\n };\n\n #update = () => {\n const primary = this.#findPrimary();\n const discoveredProps = this.#registrations\n .filter(registration => registration !== primary)\n .map(registration => registration.props);\n for (const registration of this.#registrations) {\n if (registration === primary) {\n registration.onChange({\n type: 'primary',\n discoveredProps,\n });\n } else {\n registration.onChange(registration.secondaryInstance);\n }\n }\n };\n\n #scheduleUpdate = debounce(() => this.#update(), 0);\n\n register = (\n forceType: RegistrationType | undefined,\n onRegistrationChange: RegistrationChangeHandler<Props>\n ): (() => void) => {\n const hasForcedPrimary = this.#registrations.some(instance => instance.forceType === 'primary');\n if (forceType === 'primary' && hasForcedPrimary) {\n throw new Error('Double primary registration attempt');\n }\n\n const registration: RegistrationInternal<Props> = {\n forceType,\n onChange: onRegistrationChange,\n props: {} as Props,\n secondaryInstance: {\n type: 'secondary',\n update: props => {\n registration.props = props;\n this.#scheduleUpdate();\n },\n },\n };\n this.#registrations.push(registration);\n\n this.#update();\n\n return () => {\n this.#registrations.splice(this.#registrations.indexOf(registration), 1);\n this.#scheduleUpdate();\n };\n };\n\n getStateForTesting = () => {\n return {\n registrations: this.#registrations,\n };\n };\n\n installInternal = (\n internalApi: Partial<AppLayoutWidgetApiInternal<Props>> = {}\n ): AppLayoutWidgetApiInternal<Props> => {\n internalApi.register ??= this.register;\n internalApi.getStateForTesting ??= this.getStateForTesting;\n return internalApi as AppLayoutWidgetApiInternal<Props>;\n };\n}\n"]}
1
+ {"version":3,"file":"app-layout-widget.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAkCtC,MAAM,OAAO,yBAAyB;IAAtC;QACE,mDAAqD,EAAE,EAAC;QAExD,iDAAe,GAAG,EAAE;YAClB,MAAM,aAAa,GAAG,uBAAA,IAAI,gDAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;YACrG,IAAI,aAAa,EAAE;gBACjB,OAAO,aAAa,CAAC;aACtB;YACD,KAAK,MAAM,YAAY,IAAI,uBAAA,IAAI,gDAAe,CAAC,KAAK,EAAE,EAAE;gBACtD,IAAI,YAAY,CAAC,SAAS,KAAK,WAAW,EAAE;oBAC1C,OAAO,YAAY,CAAC;iBACrB;aACF;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,EAAC;QAEF,4CAAU,GAAG,EAAE;YACb,MAAM,OAAO,GAAG,uBAAA,IAAI,8CAAa,MAAjB,IAAI,CAAe,CAAC;YACpC,MAAM,eAAe,GAAG,uBAAA,IAAI,gDAAe;iBACxC,MAAM,CAAC,YAAY,CAAC,EA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YAEf,OAAO,GAAG,EAAE;gBACV,uBAAA,IAAI,gDAAe,CAAC,MAAM,CAAC,uBAAA,IAAI,gDAAe,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;gBACzE,uBAAA,IAAI,iDAAgB,MAApB,IAAI,CAAkB,CAAC;YACzB,CAAC,CAAC;QACJ,CAAC,CAAC;QAEF,uBAAkB,GAAG,GAAG,EAAE;YACxB,OAAO;gBACL,aAAa,EAAE,uBAAA,IAAI,gDAAe;aACnC,CAAC;QACJ,CAAC,CAAC;QAEF,oBAAe,GAAG,CAChB,cAA0D,EAAE,EACzB,EAAE;;YACrC,MAAA,WAAW,CAAC,QAAQ,oCAApB,WAAW,CAAC,QAAQ,GAAK,IAAI,CAAC,QAAQ,EAAC;YACvC,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;YAC3D,OAAO,WAAgD,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;CAAA","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\n\ninterface PrimaryRegistration<Props> {\n type: 'primary';\n discoveredProps: Array<Props>;\n}\n\ninterface SecondaryRegistration<Props> {\n type: 'secondary';\n update: (props: Props) => void;\n}\n\nexport type RegistrationState<Props> = PrimaryRegistration<Props> | SecondaryRegistration<Props>;\nexport type RegistrationType = RegistrationState<unknown>['type'];\n\ntype RegistrationChangeHandler<Props> = (\n registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>\n) => void;\n\ninterface RegistrationInternal<Props> {\n forceType: RegistrationType | undefined;\n props: Props;\n secondaryInstance: SecondaryRegistration<Props>;\n onChange: (registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>) => void;\n}\n\nexport interface AppLayoutWidgetApiInternal<Props = unknown> {\n register(\n forceDeduplicationType: RegistrationType | undefined,\n onPropsChange: RegistrationChangeHandler<Props>\n ): () => void;\n getStateForTesting(): { registrations: Array<RegistrationInternal<Props>> };\n}\n\nexport class AppLayoutWidgetController<Props = unknown> {\n #registrations: Array<RegistrationInternal<Props>> = [];\n\n #findPrimary = () => {\n const forcedPrimary = this.#registrations.find(registration => registration.forceType === 'primary');\n if (forcedPrimary) {\n return forcedPrimary;\n }\n for (const registration of this.#registrations.slice()) {\n if (registration.forceType !== 'secondary') {\n return registration;\n }\n }\n return undefined;\n };\n\n #update = () => {\n const primary = this.#findPrimary();\n const discoveredProps = this.#registrations\n .filter(registration => registration !== primary)\n .map(registration => registration.props);\n for (const registration of this.#registrations) {\n if (registration === primary) {\n registration.onChange({\n type: 'primary',\n discoveredProps,\n });\n } else {\n registration.onChange(registration.secondaryInstance);\n }\n }\n };\n\n #scheduleUpdate = debounce(() => this.#update(), 0);\n\n register = (\n forceType: RegistrationType | undefined,\n onRegistrationChange: RegistrationChangeHandler<Props>\n ): (() => void) => {\n const hasForcedPrimary = this.#registrations.some(instance => instance.forceType === 'primary');\n if (forceType === 'primary' && hasForcedPrimary) {\n throw new Error('Double primary registration attempt');\n }\n\n const registration: RegistrationInternal<Props> = {\n forceType,\n onChange: onRegistrationChange,\n props: {} as Props,\n secondaryInstance: {\n type: 'secondary',\n update: props => {\n registration.props = props;\n this.#scheduleUpdate();\n },\n },\n };\n this.#registrations.push(registration);\n\n this.#update();\n\n return () => {\n this.#registrations.splice(this.#registrations.indexOf(registration), 1);\n this.#scheduleUpdate();\n };\n };\n\n getStateForTesting = () => {\n return {\n registrations: this.#registrations,\n };\n };\n\n installInternal = (\n internalApi: Partial<AppLayoutWidgetApiInternal<Props>> = {}\n ): AppLayoutWidgetApiInternal<Props> => {\n internalApi.register ??= this.register;\n internalApi.getStateForTesting ??= this.getStateForTesting;\n return internalApi as AppLayoutWidgetApiInternal<Props>;\n };\n}\n"]}
package/package.json CHANGED
@@ -126,7 +126,7 @@
126
126
  "./internal/base-component/index.js",
127
127
  "./internal/base-component/styles.css.js"
128
128
  ],
129
- "version": "3.0.734",
129
+ "version": "3.0.735",
130
130
  "repository": {
131
131
  "type": "git",
132
132
  "url": "https://github.com/cloudscape-design/components.git"