@osdk/widget.api 3.4.0-beta.9 → 3.5.0-beta.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/CHANGELOG.md +35 -0
- package/build/browser/config.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/manifest.js.map +1 -1
- package/build/browser/permissions.js +34 -0
- package/build/browser/permissions.js.map +1 -0
- package/build/cjs/index.d.cts +28 -1
- package/build/esm/config.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/manifest.js.map +1 -1
- package/build/esm/permissions.js +34 -0
- package/build/esm/permissions.js.map +1 -0
- package/build/types/config.d.ts +2 -0
- package/build/types/config.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/manifest.d.ts +8 -0
- package/build/types/manifest.d.ts.map +1 -1
- package/build/types/permissions.d.ts +18 -0
- package/build/types/permissions.d.ts.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @osdk/widget.api
|
|
2
2
|
|
|
3
|
+
## 3.4.0-beta.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @osdk/api@2.7.0-beta.14
|
|
8
|
+
|
|
9
|
+
## 3.4.0-beta.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [fb83808]
|
|
14
|
+
- @osdk/api@2.7.0-beta.13
|
|
15
|
+
|
|
16
|
+
## 3.4.0-beta.12
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [bb9d25c]
|
|
21
|
+
- @osdk/api@2.7.0-beta.12
|
|
22
|
+
|
|
23
|
+
## 3.4.0-beta.11
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [d5cfc38]
|
|
28
|
+
- @osdk/api@2.7.0-beta.11
|
|
29
|
+
|
|
30
|
+
## 3.4.0-beta.10
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [db44f6b]
|
|
35
|
+
- Updated dependencies [24a1e29]
|
|
36
|
+
- @osdk/api@2.7.0-beta.10
|
|
37
|
+
|
|
3
38
|
## 3.4.0-beta.9
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["defineConfig","c"],"sources":["config.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectType, ParameterValue } from \"./parameters.js\";\nimport type { AsyncValue } from \"./utils/asyncValue.js\";\n\ninterface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {\n type: T;\n displayName: string;\n}\ninterface ArrayParameterDefinition<S extends ParameterValue.PrimitiveType> {\n type: ParameterValue.Array[\"type\"];\n displayName: string;\n subType: S;\n}\ninterface ObjectSetParameterDefinition<T extends ObjectType> {\n type: \"objectSet\";\n displayName: string;\n objectType: T;\n}\nexport type ParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ObjectSetParameterDefinition<ObjectType>;\n\ninterface ManifestObjectSetParameterDefinition<T extends ObjectType> {\n type: ObjectSetParameterDefinition<T>[\"type\"];\n displayName: string;\n objectTypeRids: [string];\n}\n\nexport type ManifestParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ManifestObjectSetParameterDefinition<ObjectType>;\n\nexport interface EventDefinition<P extends ParameterConfig> {\n displayName: string;\n parameterUpdateIds: Array<ParameterId<P>>;\n}\n\nexport type ParameterConfig = Record<string, ParameterDefinition>;\n\nexport interface WidgetConfig<P extends ParameterConfig> {\n id: string;\n name: string;\n description?: string;\n // TODO: Add specific config for each type of widget. For now, all the config is generic and can be used by any widget.\n type: \"workshop\";\n parameters: ParameterConfig;\n events: { [eventId: string]: EventDefinition<NoInfer<P>> };\n}\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\nexport type ParameterId<C extends ParameterConfig> = Extract<keyof C, string>;\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\nexport type AsyncParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S>\n // If it's an array, pull out the subtype correctly\n ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: \"array\";\n subType: S;\n value: AsyncValue<P>;\n }\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? {\n type: \"objectSet\";\n value: AsyncValue<P>;\n }\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: C[\"parameters\"][K][\"type\"];\n value: AsyncValue<P>;\n }\n : never;\n};\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\nexport type ParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S> ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never;\n};\n\nexport type EventId<C extends WidgetConfig<C[\"parameters\"]>> =\n keyof C[\"events\"];\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\nexport type EventParameterIdList<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = C[\"events\"][K][\"parameterUpdateIds\"] extends\n Array<ParameterId<C[\"parameters\"]>> ? C[\"events\"][K][\"parameterUpdateIds\"]\n : never;\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\nexport type EventParameterValueMap<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = NotEmptyObject<\n {\n [P in EventParameterIdList<C, K>[number]]: ParameterValueMap<C>[P];\n }\n>;\n\ntype NotEmptyObject<T extends Record<string, any>> = T extends\n Record<string, never> ? Record<string, never>\n : T;\n\nexport function defineConfig<const C extends WidgetConfig<any>>(c: C): C {\n return c as any;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"config.js","names":["defineConfig","c"],"sources":["config.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectType, ParameterValue } from \"./parameters.js\";\nimport type { BrowserPermission } from \"./permissions.js\";\nimport type { AsyncValue } from \"./utils/asyncValue.js\";\n\ninterface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {\n type: T;\n displayName: string;\n}\ninterface ArrayParameterDefinition<S extends ParameterValue.PrimitiveType> {\n type: ParameterValue.Array[\"type\"];\n displayName: string;\n subType: S;\n}\ninterface ObjectSetParameterDefinition<T extends ObjectType> {\n type: \"objectSet\";\n displayName: string;\n objectType: T;\n}\nexport type ParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ObjectSetParameterDefinition<ObjectType>;\n\ninterface ManifestObjectSetParameterDefinition<T extends ObjectType> {\n type: ObjectSetParameterDefinition<T>[\"type\"];\n displayName: string;\n objectTypeRids: [string];\n}\n\nexport type ManifestParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ManifestObjectSetParameterDefinition<ObjectType>;\n\nexport interface EventDefinition<P extends ParameterConfig> {\n displayName: string;\n parameterUpdateIds: Array<ParameterId<P>>;\n}\n\nexport type ParameterConfig = Record<string, ParameterDefinition>;\n\nexport interface WidgetConfig<P extends ParameterConfig> {\n id: string;\n name: string;\n description?: string;\n // TODO: Add specific config for each type of widget. For now, all the config is generic and can be used by any widget.\n type: \"workshop\";\n parameters: ParameterConfig;\n events: { [eventId: string]: EventDefinition<NoInfer<P>> };\n permissions?: BrowserPermission[];\n}\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\nexport type ParameterId<C extends ParameterConfig> = Extract<keyof C, string>;\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\nexport type AsyncParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S>\n // If it's an array, pull out the subtype correctly\n ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: \"array\";\n subType: S;\n value: AsyncValue<P>;\n }\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? {\n type: \"objectSet\";\n value: AsyncValue<P>;\n }\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: C[\"parameters\"][K][\"type\"];\n value: AsyncValue<P>;\n }\n : never;\n};\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\nexport type ParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S> ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never;\n};\n\nexport type EventId<C extends WidgetConfig<C[\"parameters\"]>> =\n keyof C[\"events\"];\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\nexport type EventParameterIdList<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = C[\"events\"][K][\"parameterUpdateIds\"] extends\n Array<ParameterId<C[\"parameters\"]>> ? C[\"events\"][K][\"parameterUpdateIds\"]\n : never;\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\nexport type EventParameterValueMap<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = NotEmptyObject<\n {\n [P in EventParameterIdList<C, K>[number]]: ParameterValueMap<C>[P];\n }\n>;\n\ntype NotEmptyObject<T extends Record<string, any>> = T extends\n Record<string, never> ? Record<string, never>\n : T;\n\nexport function defineConfig<const C extends WidgetConfig<any>>(c: C): C {\n return c as any;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsDA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;;AAwBA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAcA,OAAO,SAASA,YAAYA,CAAoCC,CAAI,EAAK;EACvE,OAAOA,CAAC;AACV","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","isWidgetResizeMessage","visitWidgetMessage"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n AsyncParameterValueMap,\n EventId,\n EventParameterValueMap,\n ManifestParameterDefinition,\n ParameterConfig,\n ParameterDefinition,\n ParameterValueMap,\n WidgetConfig,\n} from \"./config.js\";\nexport { defineConfig } from \"./config.js\";\nexport type {\n OntologySdkInputSpecV1 as OntologySdkInputSpec,\n WidgetManifestConfigV1 as WidgetManifestConfig,\n WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec,\n WidgetSetInputSpecV1 as WidgetSetInputSpec,\n WidgetSetManifestV1 as WidgetSetManifest,\n} from \"./manifest.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport {\n HostMessage,\n isHostParametersUpdatedMessage,\n visitHostMessage,\n} from \"./messages/hostMessages.js\";\nexport {\n isWidgetEmitEventMessage,\n isWidgetReadyMessage,\n isWidgetResizeMessage,\n visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { ObjectType, ParameterValue } from \"./parameters.js\";\nexport type {\n AsyncFailedValue,\n AsyncLoadedValue,\n AsyncLoadingValue,\n AsyncNotStartedLoadingValue,\n AsyncReloadingValue,\n AsyncValue,\n} from \"./utils/asyncValue.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,8BAA8B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","isWidgetResizeMessage","visitWidgetMessage"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n AsyncParameterValueMap,\n EventId,\n EventParameterValueMap,\n ManifestParameterDefinition,\n ParameterConfig,\n ParameterDefinition,\n ParameterValueMap,\n WidgetConfig,\n} from \"./config.js\";\nexport { defineConfig } from \"./config.js\";\nexport type {\n OntologySdkInputSpecV1 as OntologySdkInputSpec,\n WidgetManifestConfigV1 as WidgetManifestConfig,\n WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec,\n WidgetSetInputSpecV1 as WidgetSetInputSpec,\n WidgetSetManifestV1 as WidgetSetManifest,\n} from \"./manifest.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport {\n HostMessage,\n isHostParametersUpdatedMessage,\n visitHostMessage,\n} from \"./messages/hostMessages.js\";\nexport {\n isWidgetEmitEventMessage,\n isWidgetReadyMessage,\n isWidgetResizeMessage,\n visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { ObjectType, ParameterValue } from \"./parameters.js\";\nexport type { BrowserPermission } from \"./permissions.js\";\nexport type {\n AsyncFailedValue,\n AsyncLoadedValue,\n AsyncLoadingValue,\n AsyncNotStartedLoadingValue,\n AsyncReloadingValue,\n AsyncValue,\n} from \"./utils/asyncValue.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,8BAA8B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":["MANIFEST_FILE_LOCATION"],"sources":["manifest.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n EventDefinition,\n ManifestParameterDefinition,\n ParameterConfig,\n} from \"./config.js\";\n\nexport interface WidgetSetManifestV1 {\n manifestVersion: \"1.0.0\";\n widgetSet: WidgetSetManifestContentV1;\n}\n\nexport interface WidgetSetManifestContentV1 {\n /**\n * RID of the widget set that this config corresponds to\n */\n rid: string;\n\n /**\n * The version of the widget to publish as\n */\n version: string;\n\n /**\n * Set of widgets that are available to be rendered.\n * The key can be arbitrary, and is usually the name of your entrypoint, e.g. \"main\"\n */\n widgets: Record<string, WidgetManifestConfigV1>;\n\n /**\n * The input specification for Foundry data required by the widget set.\n * @optional\n */\n inputSpec?: WidgetSetInputSpecV1;\n}\n\nexport interface WidgetManifestConfigV1 {\n /**\n * The ID of this widget. Must be unique within the widget set\n */\n id: string;\n\n /**\n * The user friendly name of this widget\n */\n name: string;\n\n /**\n * A user friendly description of this widget\n */\n description?: string;\n\n /**\n * The target Foundry UI that this widget is intended to be used in\n */\n type: \"workshopWidgetV1\";\n\n /**\n * List of entrypoint JS files to be loaded, in order. These will be placed on the page in script tags\n */\n entrypointJs: Array<{\n /** Relative path of the JS file to load */\n path: string;\n\n /** The type to use in the script tag when loading this JS file */\n type: \"module\" | \"text/javascript\";\n }>;\n\n /**\n * Any CSS files to be loaded, in order.\n * @optional\n */\n entrypointCss?: Array<{\n /** Relative path of the CSS file to load */\n path: string;\n }>;\n\n /**\n * The map of parameter IDs to their definition\n */\n parameters: Record<string, ManifestParameterDefinition>;\n\n /**\n * The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field\n */\n events: Record<string, EventDefinition<ParameterConfig>>;\n}\n\nexport interface WidgetSetInputSpecV1 {\n /**\n * The input specification for the widget set that was automatically discovered from the project's dependencies.\n * @optional\n */\n discovered?: WidgetSetDiscoveredInputSpecV1;\n}\n\nexport interface WidgetSetDiscoveredInputSpecV1 {\n /**\n * The discovered Ontology SDK packages in the project's dependencies.\n */\n sdks: Array<OntologySdkInputSpecV1>;\n}\n\nexport interface OntologySdkInputSpecV1 {\n /** The Ontology SDK package rid */\n rid: string;\n /** The Ontology SDK package version */\n version: string;\n}\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"manifest.js","names":["MANIFEST_FILE_LOCATION"],"sources":["manifest.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n EventDefinition,\n ManifestParameterDefinition,\n ParameterConfig,\n} from \"./config.js\";\nimport type { BrowserPermission } from \"./permissions.js\";\n\nexport interface WidgetSetManifestV1 {\n manifestVersion: \"1.0.0\";\n widgetSet: WidgetSetManifestContentV1;\n}\n\nexport interface WidgetSetManifestContentV1 {\n /**\n * RID of the widget set that this config corresponds to\n */\n rid: string;\n\n /**\n * The version of the widget to publish as\n */\n version: string;\n\n /**\n * Set of widgets that are available to be rendered.\n * The key can be arbitrary, and is usually the name of your entrypoint, e.g. \"main\"\n */\n widgets: Record<string, WidgetManifestConfigV1>;\n\n /**\n * The input specification for Foundry data required by the widget set.\n * @optional\n */\n inputSpec?: WidgetSetInputSpecV1;\n}\n\nexport interface WidgetManifestConfigV1 {\n /**\n * The ID of this widget. Must be unique within the widget set\n */\n id: string;\n\n /**\n * The user friendly name of this widget\n */\n name: string;\n\n /**\n * A user friendly description of this widget\n */\n description?: string;\n\n /**\n * The target Foundry UI that this widget is intended to be used in\n */\n type: \"workshopWidgetV1\";\n\n /**\n * List of entrypoint JS files to be loaded, in order. These will be placed on the page in script tags\n */\n entrypointJs: Array<{\n /** Relative path of the JS file to load */\n path: string;\n\n /** The type to use in the script tag when loading this JS file */\n type: \"module\" | \"text/javascript\";\n }>;\n\n /**\n * Any CSS files to be loaded, in order.\n * @optional\n */\n entrypointCss?: Array<{\n /** Relative path of the CSS file to load */\n path: string;\n }>;\n\n /**\n * The map of parameter IDs to their definition\n */\n parameters: Record<string, ManifestParameterDefinition>;\n\n /**\n * The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field\n */\n events: Record<string, EventDefinition<ParameterConfig>>;\n\n /**\n * The additional browser permissions requested by this widget. This does not guarantee the widget\n * will have access to the browser permission at runtime. For example, the user may need to also\n * accept a browser prompt depending on the particular permission and browser settings.\n * @optional\n */\n permissions?: BrowserPermission[];\n}\n\nexport interface WidgetSetInputSpecV1 {\n /**\n * The input specification for the widget set that was automatically discovered from the project's dependencies.\n * @optional\n */\n discovered?: WidgetSetDiscoveredInputSpecV1;\n}\n\nexport interface WidgetSetDiscoveredInputSpecV1 {\n /**\n * The discovered Ontology SDK packages in the project's dependencies.\n */\n sdks: Array<OntologySdkInputSpecV1>;\n}\n\nexport interface OntologySdkInputSpecV1 {\n /** The Ontology SDK package rid */\n rid: string;\n /** The Ontology SDK package version */\n version: string;\n}\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwHA,OAAO,MAAMA,sBAAsB,GAAG,+BAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An additional browser permission that can be requested by a widget.
|
|
19
|
+
*/
|
|
20
|
+
export const BrowserPermission = {
|
|
21
|
+
/** The permissions policy allow camera attribute value */
|
|
22
|
+
CAMERA: "camera",
|
|
23
|
+
/** The permissions policy allow microphone attribute value */
|
|
24
|
+
MICROPHONE: "microphone",
|
|
25
|
+
/** The permissions policy allow autoplay attribute value */
|
|
26
|
+
AUTOPLAY: "autoplay",
|
|
27
|
+
/** The sandbox allow-downloads attribute value */
|
|
28
|
+
ALLOW_DOWNLOADS: "allow-downloads",
|
|
29
|
+
/** The sandbox allow-forms attribute value */
|
|
30
|
+
ALLOW_FORMS: "allow-forms",
|
|
31
|
+
/** The sandbox allow-popups attribute value */
|
|
32
|
+
ALLOW_POPUPS: "allow-popups"
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","names":["BrowserPermission","CAMERA","MICROPHONE","AUTOPLAY","ALLOW_DOWNLOADS","ALLOW_FORMS","ALLOW_POPUPS"],"sources":["permissions.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An additional browser permission that can be requested by a widget.\n */\nexport const BrowserPermission = {\n /** The permissions policy allow camera attribute value */\n CAMERA: \"camera\",\n /** The permissions policy allow microphone attribute value */\n MICROPHONE: \"microphone\",\n /** The permissions policy allow autoplay attribute value */\n AUTOPLAY: \"autoplay\",\n /** The sandbox allow-downloads attribute value */\n ALLOW_DOWNLOADS: \"allow-downloads\",\n /** The sandbox allow-forms attribute value */\n ALLOW_FORMS: \"allow-forms\",\n /** The sandbox allow-popups attribute value */\n ALLOW_POPUPS: \"allow-popups\",\n} as const;\nexport type BrowserPermission =\n typeof BrowserPermission[keyof typeof BrowserPermission];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAG;EAC/B;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,WAAW,EAAE,aAAa;EAC1B;EACAC,YAAY,EAAE;AAChB,CAAU","ignoreList":[]}
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -87,6 +87,25 @@ declare namespace ParameterValue {
|
|
|
87
87
|
}
|
|
88
88
|
type ParameterValue = ParameterValue.String | ParameterValue.Number | ParameterValue.Boolean | ParameterValue.Date | ParameterValue.Timestamp | ParameterValue.ObjectSet | ParameterValue.Array;
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* An additional browser permission that can be requested by a widget.
|
|
92
|
+
*/
|
|
93
|
+
declare const BrowserPermission: {
|
|
94
|
+
/** The permissions policy allow camera attribute value */
|
|
95
|
+
readonly CAMERA: "camera";
|
|
96
|
+
/** The permissions policy allow microphone attribute value */
|
|
97
|
+
readonly MICROPHONE: "microphone";
|
|
98
|
+
/** The permissions policy allow autoplay attribute value */
|
|
99
|
+
readonly AUTOPLAY: "autoplay";
|
|
100
|
+
/** The sandbox allow-downloads attribute value */
|
|
101
|
+
readonly ALLOW_DOWNLOADS: "allow-downloads";
|
|
102
|
+
/** The sandbox allow-forms attribute value */
|
|
103
|
+
readonly ALLOW_FORMS: "allow-forms";
|
|
104
|
+
/** The sandbox allow-popups attribute value */
|
|
105
|
+
readonly ALLOW_POPUPS: "allow-popups";
|
|
106
|
+
};
|
|
107
|
+
type BrowserPermission = typeof BrowserPermission[keyof typeof BrowserPermission];
|
|
108
|
+
|
|
90
109
|
interface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {
|
|
91
110
|
type: T;
|
|
92
111
|
displayName: string;
|
|
@@ -122,6 +141,7 @@ interface WidgetConfig<P extends ParameterConfig> {
|
|
|
122
141
|
events: {
|
|
123
142
|
[eventId: string]: EventDefinition<NoInfer<P>>;
|
|
124
143
|
};
|
|
144
|
+
permissions?: BrowserPermission[];
|
|
125
145
|
}
|
|
126
146
|
/**
|
|
127
147
|
* Extracts the parameter ID strings as types from the given ParameterConfig.
|
|
@@ -240,6 +260,13 @@ interface WidgetManifestConfigV1 {
|
|
|
240
260
|
* The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field
|
|
241
261
|
*/
|
|
242
262
|
events: Record<string, EventDefinition<ParameterConfig>>;
|
|
263
|
+
/**
|
|
264
|
+
* The additional browser permissions requested by this widget. This does not guarantee the widget
|
|
265
|
+
* will have access to the browser permission at runtime. For example, the user may need to also
|
|
266
|
+
* accept a browser prompt depending on the particular permission and browser settings.
|
|
267
|
+
* @optional
|
|
268
|
+
*/
|
|
269
|
+
permissions?: BrowserPermission[];
|
|
243
270
|
}
|
|
244
271
|
interface WidgetSetInputSpecV1 {
|
|
245
272
|
/**
|
|
@@ -349,4 +376,4 @@ type WidgetMessageVisitor<C extends WidgetConfig<C["parameters"]>> = {
|
|
|
349
376
|
};
|
|
350
377
|
declare function visitWidgetMessage<C extends WidgetConfig<C["parameters"]>>(message: WidgetMessage<C>, visitor: WidgetMessageVisitor<C>): void;
|
|
351
378
|
|
|
352
|
-
export { type AsyncFailedValue, type AsyncLoadedValue, type AsyncLoadingValue, type AsyncNotStartedLoadingValue, type AsyncParameterValueMap, type AsyncReloadingValue, type AsyncValue, type EventId, type EventParameterValueMap, HostMessage, MANIFEST_FILE_LOCATION, type ManifestParameterDefinition, type ObjectType, type OntologySdkInputSpecV1 as OntologySdkInputSpec, type ParameterConfig, type ParameterDefinition, ParameterValue, type ParameterValueMap, type WidgetConfig, type WidgetManifestConfigV1 as WidgetManifestConfig, WidgetMessage, type WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec, type WidgetSetInputSpecV1 as WidgetSetInputSpec, type WidgetSetManifestV1 as WidgetSetManifest, defineConfig, isHostParametersUpdatedMessage, isWidgetEmitEventMessage, isWidgetReadyMessage, isWidgetResizeMessage, visitHostMessage, visitWidgetMessage };
|
|
379
|
+
export { type AsyncFailedValue, type AsyncLoadedValue, type AsyncLoadingValue, type AsyncNotStartedLoadingValue, type AsyncParameterValueMap, type AsyncReloadingValue, type AsyncValue, BrowserPermission, type EventId, type EventParameterValueMap, HostMessage, MANIFEST_FILE_LOCATION, type ManifestParameterDefinition, type ObjectType, type OntologySdkInputSpecV1 as OntologySdkInputSpec, type ParameterConfig, type ParameterDefinition, ParameterValue, type ParameterValueMap, type WidgetConfig, type WidgetManifestConfigV1 as WidgetManifestConfig, WidgetMessage, type WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec, type WidgetSetInputSpecV1 as WidgetSetInputSpec, type WidgetSetManifestV1 as WidgetSetManifest, defineConfig, isHostParametersUpdatedMessage, isWidgetEmitEventMessage, isWidgetReadyMessage, isWidgetResizeMessage, visitHostMessage, visitWidgetMessage };
|
package/build/esm/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["defineConfig","c"],"sources":["config.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectType, ParameterValue } from \"./parameters.js\";\nimport type { AsyncValue } from \"./utils/asyncValue.js\";\n\ninterface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {\n type: T;\n displayName: string;\n}\ninterface ArrayParameterDefinition<S extends ParameterValue.PrimitiveType> {\n type: ParameterValue.Array[\"type\"];\n displayName: string;\n subType: S;\n}\ninterface ObjectSetParameterDefinition<T extends ObjectType> {\n type: \"objectSet\";\n displayName: string;\n objectType: T;\n}\nexport type ParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ObjectSetParameterDefinition<ObjectType>;\n\ninterface ManifestObjectSetParameterDefinition<T extends ObjectType> {\n type: ObjectSetParameterDefinition<T>[\"type\"];\n displayName: string;\n objectTypeRids: [string];\n}\n\nexport type ManifestParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ManifestObjectSetParameterDefinition<ObjectType>;\n\nexport interface EventDefinition<P extends ParameterConfig> {\n displayName: string;\n parameterUpdateIds: Array<ParameterId<P>>;\n}\n\nexport type ParameterConfig = Record<string, ParameterDefinition>;\n\nexport interface WidgetConfig<P extends ParameterConfig> {\n id: string;\n name: string;\n description?: string;\n // TODO: Add specific config for each type of widget. For now, all the config is generic and can be used by any widget.\n type: \"workshop\";\n parameters: ParameterConfig;\n events: { [eventId: string]: EventDefinition<NoInfer<P>> };\n}\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\nexport type ParameterId<C extends ParameterConfig> = Extract<keyof C, string>;\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\nexport type AsyncParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S>\n // If it's an array, pull out the subtype correctly\n ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: \"array\";\n subType: S;\n value: AsyncValue<P>;\n }\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? {\n type: \"objectSet\";\n value: AsyncValue<P>;\n }\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: C[\"parameters\"][K][\"type\"];\n value: AsyncValue<P>;\n }\n : never;\n};\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\nexport type ParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S> ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never;\n};\n\nexport type EventId<C extends WidgetConfig<C[\"parameters\"]>> =\n keyof C[\"events\"];\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\nexport type EventParameterIdList<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = C[\"events\"][K][\"parameterUpdateIds\"] extends\n Array<ParameterId<C[\"parameters\"]>> ? C[\"events\"][K][\"parameterUpdateIds\"]\n : never;\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\nexport type EventParameterValueMap<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = NotEmptyObject<\n {\n [P in EventParameterIdList<C, K>[number]]: ParameterValueMap<C>[P];\n }\n>;\n\ntype NotEmptyObject<T extends Record<string, any>> = T extends\n Record<string, never> ? Record<string, never>\n : T;\n\nexport function defineConfig<const C extends WidgetConfig<any>>(c: C): C {\n return c as any;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"config.js","names":["defineConfig","c"],"sources":["config.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectType, ParameterValue } from \"./parameters.js\";\nimport type { BrowserPermission } from \"./permissions.js\";\nimport type { AsyncValue } from \"./utils/asyncValue.js\";\n\ninterface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {\n type: T;\n displayName: string;\n}\ninterface ArrayParameterDefinition<S extends ParameterValue.PrimitiveType> {\n type: ParameterValue.Array[\"type\"];\n displayName: string;\n subType: S;\n}\ninterface ObjectSetParameterDefinition<T extends ObjectType> {\n type: \"objectSet\";\n displayName: string;\n objectType: T;\n}\nexport type ParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ObjectSetParameterDefinition<ObjectType>;\n\ninterface ManifestObjectSetParameterDefinition<T extends ObjectType> {\n type: ObjectSetParameterDefinition<T>[\"type\"];\n displayName: string;\n objectTypeRids: [string];\n}\n\nexport type ManifestParameterDefinition =\n | PrimitiveParameterDefinition<ParameterValue.PrimitiveType>\n | ArrayParameterDefinition<ParameterValue.PrimitiveType>\n | ManifestObjectSetParameterDefinition<ObjectType>;\n\nexport interface EventDefinition<P extends ParameterConfig> {\n displayName: string;\n parameterUpdateIds: Array<ParameterId<P>>;\n}\n\nexport type ParameterConfig = Record<string, ParameterDefinition>;\n\nexport interface WidgetConfig<P extends ParameterConfig> {\n id: string;\n name: string;\n description?: string;\n // TODO: Add specific config for each type of widget. For now, all the config is generic and can be used by any widget.\n type: \"workshop\";\n parameters: ParameterConfig;\n events: { [eventId: string]: EventDefinition<NoInfer<P>> };\n permissions?: BrowserPermission[];\n}\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\nexport type ParameterId<C extends ParameterConfig> = Extract<keyof C, string>;\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\nexport type AsyncParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S>\n // If it's an array, pull out the subtype correctly\n ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: \"array\";\n subType: S;\n value: AsyncValue<P>;\n }\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? {\n type: \"objectSet\";\n value: AsyncValue<P>;\n }\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? {\n type: C[\"parameters\"][K][\"type\"];\n value: AsyncValue<P>;\n }\n : never;\n};\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\nexport type ParameterValueMap<C extends WidgetConfig<C[\"parameters\"]>> = {\n [\n K in ParameterId<\n C[\"parameters\"]\n >\n ]: C[\"parameters\"][K] extends ArrayParameterDefinition<infer S> ? Extract<\n ParameterValue.Array,\n { type: C[\"parameters\"][K][\"type\"]; subType: S }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : C[\"parameters\"][K] extends ObjectSetParameterDefinition<infer T>\n ? ParameterValue.ObjectSet<T>[\"value\"] extends AsyncValue<infer P> ? P\n : never\n : Extract<\n ParameterValue,\n { type: C[\"parameters\"][K][\"type\"] }\n >[\"value\"] extends AsyncValue<infer P> ? P\n : never;\n};\n\nexport type EventId<C extends WidgetConfig<C[\"parameters\"]>> =\n keyof C[\"events\"];\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\nexport type EventParameterIdList<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = C[\"events\"][K][\"parameterUpdateIds\"] extends\n Array<ParameterId<C[\"parameters\"]>> ? C[\"events\"][K][\"parameterUpdateIds\"]\n : never;\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\nexport type EventParameterValueMap<\n C extends WidgetConfig<C[\"parameters\"]>,\n K extends EventId<C>,\n> = NotEmptyObject<\n {\n [P in EventParameterIdList<C, K>[number]]: ParameterValueMap<C>[P];\n }\n>;\n\ntype NotEmptyObject<T extends Record<string, any>> = T extends\n Record<string, never> ? Record<string, never>\n : T;\n\nexport function defineConfig<const C extends WidgetConfig<any>>(c: C): C {\n return c as any;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsDA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;;AAwBA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAcA,OAAO,SAASA,YAAYA,CAAoCC,CAAI,EAAK;EACvE,OAAOA,CAAC;AACV","ignoreList":[]}
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","isWidgetResizeMessage","visitWidgetMessage"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n AsyncParameterValueMap,\n EventId,\n EventParameterValueMap,\n ManifestParameterDefinition,\n ParameterConfig,\n ParameterDefinition,\n ParameterValueMap,\n WidgetConfig,\n} from \"./config.js\";\nexport { defineConfig } from \"./config.js\";\nexport type {\n OntologySdkInputSpecV1 as OntologySdkInputSpec,\n WidgetManifestConfigV1 as WidgetManifestConfig,\n WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec,\n WidgetSetInputSpecV1 as WidgetSetInputSpec,\n WidgetSetManifestV1 as WidgetSetManifest,\n} from \"./manifest.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport {\n HostMessage,\n isHostParametersUpdatedMessage,\n visitHostMessage,\n} from \"./messages/hostMessages.js\";\nexport {\n isWidgetEmitEventMessage,\n isWidgetReadyMessage,\n isWidgetResizeMessage,\n visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { ObjectType, ParameterValue } from \"./parameters.js\";\nexport type {\n AsyncFailedValue,\n AsyncLoadedValue,\n AsyncLoadingValue,\n AsyncNotStartedLoadingValue,\n AsyncReloadingValue,\n AsyncValue,\n} from \"./utils/asyncValue.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,8BAA8B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","isWidgetResizeMessage","visitWidgetMessage"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n AsyncParameterValueMap,\n EventId,\n EventParameterValueMap,\n ManifestParameterDefinition,\n ParameterConfig,\n ParameterDefinition,\n ParameterValueMap,\n WidgetConfig,\n} from \"./config.js\";\nexport { defineConfig } from \"./config.js\";\nexport type {\n OntologySdkInputSpecV1 as OntologySdkInputSpec,\n WidgetManifestConfigV1 as WidgetManifestConfig,\n WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec,\n WidgetSetInputSpecV1 as WidgetSetInputSpec,\n WidgetSetManifestV1 as WidgetSetManifest,\n} from \"./manifest.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport {\n HostMessage,\n isHostParametersUpdatedMessage,\n visitHostMessage,\n} from \"./messages/hostMessages.js\";\nexport {\n isWidgetEmitEventMessage,\n isWidgetReadyMessage,\n isWidgetResizeMessage,\n visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { ObjectType, ParameterValue } from \"./parameters.js\";\nexport type { BrowserPermission } from \"./permissions.js\";\nexport type {\n AsyncFailedValue,\n AsyncLoadedValue,\n AsyncLoadingValue,\n AsyncNotStartedLoadingValue,\n AsyncReloadingValue,\n AsyncValue,\n} from \"./utils/asyncValue.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,8BAA8B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":["MANIFEST_FILE_LOCATION"],"sources":["manifest.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n EventDefinition,\n ManifestParameterDefinition,\n ParameterConfig,\n} from \"./config.js\";\n\nexport interface WidgetSetManifestV1 {\n manifestVersion: \"1.0.0\";\n widgetSet: WidgetSetManifestContentV1;\n}\n\nexport interface WidgetSetManifestContentV1 {\n /**\n * RID of the widget set that this config corresponds to\n */\n rid: string;\n\n /**\n * The version of the widget to publish as\n */\n version: string;\n\n /**\n * Set of widgets that are available to be rendered.\n * The key can be arbitrary, and is usually the name of your entrypoint, e.g. \"main\"\n */\n widgets: Record<string, WidgetManifestConfigV1>;\n\n /**\n * The input specification for Foundry data required by the widget set.\n * @optional\n */\n inputSpec?: WidgetSetInputSpecV1;\n}\n\nexport interface WidgetManifestConfigV1 {\n /**\n * The ID of this widget. Must be unique within the widget set\n */\n id: string;\n\n /**\n * The user friendly name of this widget\n */\n name: string;\n\n /**\n * A user friendly description of this widget\n */\n description?: string;\n\n /**\n * The target Foundry UI that this widget is intended to be used in\n */\n type: \"workshopWidgetV1\";\n\n /**\n * List of entrypoint JS files to be loaded, in order. These will be placed on the page in script tags\n */\n entrypointJs: Array<{\n /** Relative path of the JS file to load */\n path: string;\n\n /** The type to use in the script tag when loading this JS file */\n type: \"module\" | \"text/javascript\";\n }>;\n\n /**\n * Any CSS files to be loaded, in order.\n * @optional\n */\n entrypointCss?: Array<{\n /** Relative path of the CSS file to load */\n path: string;\n }>;\n\n /**\n * The map of parameter IDs to their definition\n */\n parameters: Record<string, ManifestParameterDefinition>;\n\n /**\n * The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field\n */\n events: Record<string, EventDefinition<ParameterConfig>>;\n}\n\nexport interface WidgetSetInputSpecV1 {\n /**\n * The input specification for the widget set that was automatically discovered from the project's dependencies.\n * @optional\n */\n discovered?: WidgetSetDiscoveredInputSpecV1;\n}\n\nexport interface WidgetSetDiscoveredInputSpecV1 {\n /**\n * The discovered Ontology SDK packages in the project's dependencies.\n */\n sdks: Array<OntologySdkInputSpecV1>;\n}\n\nexport interface OntologySdkInputSpecV1 {\n /** The Ontology SDK package rid */\n rid: string;\n /** The Ontology SDK package version */\n version: string;\n}\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"manifest.js","names":["MANIFEST_FILE_LOCATION"],"sources":["manifest.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n EventDefinition,\n ManifestParameterDefinition,\n ParameterConfig,\n} from \"./config.js\";\nimport type { BrowserPermission } from \"./permissions.js\";\n\nexport interface WidgetSetManifestV1 {\n manifestVersion: \"1.0.0\";\n widgetSet: WidgetSetManifestContentV1;\n}\n\nexport interface WidgetSetManifestContentV1 {\n /**\n * RID of the widget set that this config corresponds to\n */\n rid: string;\n\n /**\n * The version of the widget to publish as\n */\n version: string;\n\n /**\n * Set of widgets that are available to be rendered.\n * The key can be arbitrary, and is usually the name of your entrypoint, e.g. \"main\"\n */\n widgets: Record<string, WidgetManifestConfigV1>;\n\n /**\n * The input specification for Foundry data required by the widget set.\n * @optional\n */\n inputSpec?: WidgetSetInputSpecV1;\n}\n\nexport interface WidgetManifestConfigV1 {\n /**\n * The ID of this widget. Must be unique within the widget set\n */\n id: string;\n\n /**\n * The user friendly name of this widget\n */\n name: string;\n\n /**\n * A user friendly description of this widget\n */\n description?: string;\n\n /**\n * The target Foundry UI that this widget is intended to be used in\n */\n type: \"workshopWidgetV1\";\n\n /**\n * List of entrypoint JS files to be loaded, in order. These will be placed on the page in script tags\n */\n entrypointJs: Array<{\n /** Relative path of the JS file to load */\n path: string;\n\n /** The type to use in the script tag when loading this JS file */\n type: \"module\" | \"text/javascript\";\n }>;\n\n /**\n * Any CSS files to be loaded, in order.\n * @optional\n */\n entrypointCss?: Array<{\n /** Relative path of the CSS file to load */\n path: string;\n }>;\n\n /**\n * The map of parameter IDs to their definition\n */\n parameters: Record<string, ManifestParameterDefinition>;\n\n /**\n * The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field\n */\n events: Record<string, EventDefinition<ParameterConfig>>;\n\n /**\n * The additional browser permissions requested by this widget. This does not guarantee the widget\n * will have access to the browser permission at runtime. For example, the user may need to also\n * accept a browser prompt depending on the particular permission and browser settings.\n * @optional\n */\n permissions?: BrowserPermission[];\n}\n\nexport interface WidgetSetInputSpecV1 {\n /**\n * The input specification for the widget set that was automatically discovered from the project's dependencies.\n * @optional\n */\n discovered?: WidgetSetDiscoveredInputSpecV1;\n}\n\nexport interface WidgetSetDiscoveredInputSpecV1 {\n /**\n * The discovered Ontology SDK packages in the project's dependencies.\n */\n sdks: Array<OntologySdkInputSpecV1>;\n}\n\nexport interface OntologySdkInputSpecV1 {\n /** The Ontology SDK package rid */\n rid: string;\n /** The Ontology SDK package version */\n version: string;\n}\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwHA,OAAO,MAAMA,sBAAsB,GAAG,+BAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An additional browser permission that can be requested by a widget.
|
|
19
|
+
*/
|
|
20
|
+
export const BrowserPermission = {
|
|
21
|
+
/** The permissions policy allow camera attribute value */
|
|
22
|
+
CAMERA: "camera",
|
|
23
|
+
/** The permissions policy allow microphone attribute value */
|
|
24
|
+
MICROPHONE: "microphone",
|
|
25
|
+
/** The permissions policy allow autoplay attribute value */
|
|
26
|
+
AUTOPLAY: "autoplay",
|
|
27
|
+
/** The sandbox allow-downloads attribute value */
|
|
28
|
+
ALLOW_DOWNLOADS: "allow-downloads",
|
|
29
|
+
/** The sandbox allow-forms attribute value */
|
|
30
|
+
ALLOW_FORMS: "allow-forms",
|
|
31
|
+
/** The sandbox allow-popups attribute value */
|
|
32
|
+
ALLOW_POPUPS: "allow-popups"
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","names":["BrowserPermission","CAMERA","MICROPHONE","AUTOPLAY","ALLOW_DOWNLOADS","ALLOW_FORMS","ALLOW_POPUPS"],"sources":["permissions.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An additional browser permission that can be requested by a widget.\n */\nexport const BrowserPermission = {\n /** The permissions policy allow camera attribute value */\n CAMERA: \"camera\",\n /** The permissions policy allow microphone attribute value */\n MICROPHONE: \"microphone\",\n /** The permissions policy allow autoplay attribute value */\n AUTOPLAY: \"autoplay\",\n /** The sandbox allow-downloads attribute value */\n ALLOW_DOWNLOADS: \"allow-downloads\",\n /** The sandbox allow-forms attribute value */\n ALLOW_FORMS: \"allow-forms\",\n /** The sandbox allow-popups attribute value */\n ALLOW_POPUPS: \"allow-popups\",\n} as const;\nexport type BrowserPermission =\n typeof BrowserPermission[keyof typeof BrowserPermission];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAG;EAC/B;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,WAAW,EAAE,aAAa;EAC1B;EACAC,YAAY,EAAE;AAChB,CAAU","ignoreList":[]}
|
package/build/types/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ObjectType, ParameterValue } from "./parameters.js";
|
|
2
|
+
import type { BrowserPermission } from "./permissions.js";
|
|
2
3
|
import type { AsyncValue } from "./utils/asyncValue.js";
|
|
3
4
|
interface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {
|
|
4
5
|
type: T;
|
|
@@ -35,6 +36,7 @@ export interface WidgetConfig<P extends ParameterConfig> {
|
|
|
35
36
|
events: {
|
|
36
37
|
[eventId: string]: EventDefinition<NoInfer<P>>
|
|
37
38
|
};
|
|
39
|
+
permissions?: BrowserPermission[];
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Extracts the parameter ID strings as types from the given ParameterConfig.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,YAAY,sBAAsB,iBAAkB;AAClE,cAAc,kBAAkB,uBAAwB;UAE9C,6BAA6B,UAAU,eAAe,eAAe;CAC7E,MAAM;CACN;AACD;UACS,yBAAyB,UAAU,eAAe,eAAe;CACzE,MAAM,eAAe,MAAM;CAC3B;CACA,SAAS;AACV;UACS,6BAA6B,UAAU,YAAY;CAC3D,MAAM;CACN;CACA,YAAY;AACb;AACD,YAAY,sBACR,6BAA6B,eAAe,iBAC5C,yBAAyB,eAAe,iBACxC,6BAA6B;UAEvB,qCAAqC,UAAU,YAAY;CACnE,MAAM,6BAA6B,GAAG;CACtC;CACA;AACD;AAED,YAAY,8BACR,6BAA6B,eAAe,iBAC5C,yBAAyB,eAAe,iBACxC,qCAAqC;AAEzC,iBAAiB,gBAAgB,UAAU,iBAAiB;CAC1D;CACA,oBAAoB,MAAM,YAAY;AACvC;AAED,YAAY,kBAAkB,eAAe;AAE7C,iBAAiB,aAAa,UAAU,iBAAiB;CACvD;CACA;CACA;CAEA,MAAM;CACN,YAAY;CACZ,QAAQ;qBAAqB,gBAAgB,QAAQ;CAAK;
|
|
1
|
+
{"mappings":"AAgBA,cAAc,YAAY,sBAAsB,iBAAkB;AAClE,cAAc,yBAAyB,kBAAmB;AAC1D,cAAc,kBAAkB,uBAAwB;UAE9C,6BAA6B,UAAU,eAAe,eAAe;CAC7E,MAAM;CACN;AACD;UACS,yBAAyB,UAAU,eAAe,eAAe;CACzE,MAAM,eAAe,MAAM;CAC3B;CACA,SAAS;AACV;UACS,6BAA6B,UAAU,YAAY;CAC3D,MAAM;CACN;CACA,YAAY;AACb;AACD,YAAY,sBACR,6BAA6B,eAAe,iBAC5C,yBAAyB,eAAe,iBACxC,6BAA6B;UAEvB,qCAAqC,UAAU,YAAY;CACnE,MAAM,6BAA6B,GAAG;CACtC;CACA;AACD;AAED,YAAY,8BACR,6BAA6B,eAAe,iBAC5C,yBAAyB,eAAe,iBACxC,qCAAqC;AAEzC,iBAAiB,gBAAgB,UAAU,iBAAiB;CAC1D;CACA,oBAAoB,MAAM,YAAY;AACvC;AAED,YAAY,kBAAkB,eAAe;AAE7C,iBAAiB,aAAa,UAAU,iBAAiB;CACvD;CACA;CACA;CAEA,MAAM;CACN,YAAY;CACZ,QAAQ;qBAAqB,gBAAgB,QAAQ;CAAK;CAC1D,cAAc;AACf;;;;AAKD,YAAY,YAAY,UAAU,mBAAmB,cAAc;;;;AAKnE,YAAY,uBAAuB,UAAU,aAAa,EAAE,qBAExD,KAAK,YACH,EAAE,kBAEH,EAAE,cAAc,WAAW,+BAA+B,KAEzD,QACA,eAAe,OACf;CAAE,MAAM,EAAE,cAAc,GAAG;CAAS,SAAS;AAAG,GAChD,iBAAiB,iBAAiB,KAAK;CACrC,MAAM;CACN,SAAS;CACT,OAAO,WAAW;AACnB,YAED,EAAE,cAAc,WAAW,mCAAmC,KAC5D,eAAe,UAAU,GAAG,iBAAiB,iBAAiB,KAAK;CACjE,MAAM;CACN,OAAO,WAAW;AACnB,YAEH,QACA,gBACA;CAAE,MAAM,EAAE,cAAc,GAAG;AAAS,GACpC,iBAAiB,iBAAiB,KAAK;CACrC,MAAM,EAAE,cAAc,GAAG;CACzB,OAAO,WAAW;AACnB;;;;AAOP,YAAY,kBAAkB,UAAU,aAAa,EAAE,qBAEnD,KAAK,YACH,EAAE,kBAEH,EAAE,cAAc,WAAW,+BAA+B,KAAK,QAC9D,eAAe,OACf;CAAE,MAAM,EAAE,cAAc,GAAG;CAAS,SAAS;AAAG,GAChD,iBAAiB,iBAAiB,KAAK,YAEvC,EAAE,cAAc,WAAW,mCAAmC,KAC5D,eAAe,UAAU,GAAG,iBAAiB,iBAAiB,KAAK,YAErE,QACA,gBACA;CAAE,MAAM,EAAE,cAAc,GAAG;AAAS,GACpC,iBAAiB,iBAAiB,KAAK;AAI7C,YAAY,QAAQ,UAAU,aAAa,EAAE,wBACrC,EAAE;;;;;AAMV,YAAY;CACV,UAAU,aAAa,EAAE;CACzB,UAAU,QAAQ;IAChB,EAAE,UAAU,GAAG,8BACjB,MAAM,YAAY,EAAE,kBAAkB,EAAE,UAAU,GAAG;;;;AAMvD,YAAY;CACV,UAAU,aAAa,EAAE;CACzB,UAAU,QAAQ;IAChB,kBAEC,KAAK,qBAAqB,GAAG,cAAa,kBAAkB,GAAG;KAI/D,eAAe,UAAU,uBAAuB,UACnD,wBAAwB,wBACtB;AAEJ,OAAO,iBAAS,mBAAmB,UAAU,mBAAmBA,GAAG,IAAI","names":["c: C"],"sources":["../../src/config.ts"],"version":3,"file":"config.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from ".
|
|
|
6
6
|
export { isWidgetEmitEventMessage, isWidgetReadyMessage, isWidgetResizeMessage, visitWidgetMessage } from "./messages/widgetMessages.js";
|
|
7
7
|
export type { WidgetMessage } from "./messages/widgetMessages.js";
|
|
8
8
|
export type { ObjectType, ParameterValue } from "./parameters.js";
|
|
9
|
+
export type { BrowserPermission } from "./permissions.js";
|
|
9
10
|
export type { AsyncFailedValue, AsyncLoadedValue, AsyncLoadingValue, AsyncNotStartedLoadingValue, AsyncReloadingValue, AsyncValue } from "./utils/asyncValue.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,wBACA,SACA,wBACA,6BACA,iBACA,qBACA,mBACA,oBACK;AACP,SAAS,oBAAoB;AAC7B,cACE,0BAA0B,sBAC1B,0BAA0B,sBAC1B,kCAAkC,8BAClC,wBAAwB,oBACxB,uBAAuB,yBAClB;AACP,SAAS,8BAA8B;AACvC,SACE,aACA,gCACA,wBACK;AACP,SACE,0BACA,sBACA,uBACA,0BACK;AACP,cAAc,qBAAqB;AACnC,cAAc,YAAY,sBAAsB;AAChD,cACE,kBACA,kBACA,mBACA,6BACA,qBACA,kBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,cACE,wBACA,SACA,wBACA,6BACA,iBACA,qBACA,mBACA,oBACK;AACP,SAAS,oBAAoB;AAC7B,cACE,0BAA0B,sBAC1B,0BAA0B,sBAC1B,kCAAkC,8BAClC,wBAAwB,oBACxB,uBAAuB,yBAClB;AACP,SAAS,8BAA8B;AACvC,SACE,aACA,gCACA,wBACK;AACP,SACE,0BACA,sBACA,uBACA,0BACK;AACP,cAAc,qBAAqB;AACnC,cAAc,YAAY,sBAAsB;AAChD,cAAc,yBAAyB;AACvC,cACE,kBACA,kBACA,mBACA,6BACA,qBACA,kBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EventDefinition, ManifestParameterDefinition, ParameterConfig } from "./config.js";
|
|
2
|
+
import type { BrowserPermission } from "./permissions.js";
|
|
2
3
|
export interface WidgetSetManifestV1 {
|
|
3
4
|
manifestVersion: "1.0.0";
|
|
4
5
|
widgetSet: WidgetSetManifestContentV1;
|
|
@@ -65,6 +66,13 @@ export interface WidgetManifestConfigV1 {
|
|
|
65
66
|
* The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field
|
|
66
67
|
*/
|
|
67
68
|
events: Record<string, EventDefinition<ParameterConfig>>;
|
|
69
|
+
/**
|
|
70
|
+
* The additional browser permissions requested by this widget. This does not guarantee the widget
|
|
71
|
+
* will have access to the browser permission at runtime. For example, the user may need to also
|
|
72
|
+
* accept a browser prompt depending on the particular permission and browser settings.
|
|
73
|
+
* @optional
|
|
74
|
+
*/
|
|
75
|
+
permissions?: BrowserPermission[];
|
|
68
76
|
}
|
|
69
77
|
export interface WidgetSetInputSpecV1 {
|
|
70
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,iBACA,6BACA,uBACK,aAAc;
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,6BACA,uBACK,aAAc;AACrB,cAAc,yBAAyB,kBAAmB;AAE1D,iBAAiB,oBAAoB;CACnC,iBAAiB;CACjB,WAAW;AACZ;AAED,iBAAiB,2BAA2B;;;;CAI1C;;;;CAKA;;;;;CAMA,SAAS,eAAe;;;;;CAMxB,YAAY;AACb;AAED,iBAAiB,uBAAuB;;;;CAItC;;;;CAKA;;;;CAKA;;;;CAKA,MAAM;;;;CAKN,cAAc,MAAM;;EAElB;;EAGA,MAAM,WAAW;CAClB;;;;;CAMD,gBAAgB,MAAM;;EAEpB;CACD;;;;CAKD,YAAY,eAAe;;;;CAK3B,QAAQ,eAAe,gBAAgB;;;;;;;CAQvC,cAAc;AACf;AAED,iBAAiB,qBAAqB;;;;;CAKpC,aAAa;AACd;AAED,iBAAiB,+BAA+B;;;;CAI9C,MAAM,MAAM;AACb;AAED,iBAAiB,uBAAuB;;CAEtC;;CAEA;AACD;AAED,OAAO,cAAM,yBAAyB","names":[],"sources":["../../src/manifest.ts"],"version":3,"file":"manifest.d.ts"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An additional browser permission that can be requested by a widget.
|
|
3
|
+
*/
|
|
4
|
+
export declare const BrowserPermission: {
|
|
5
|
+
/** The permissions policy allow camera attribute value */
|
|
6
|
+
readonly CAMERA: "camera"
|
|
7
|
+
/** The permissions policy allow microphone attribute value */
|
|
8
|
+
readonly MICROPHONE: "microphone"
|
|
9
|
+
/** The permissions policy allow autoplay attribute value */
|
|
10
|
+
readonly AUTOPLAY: "autoplay"
|
|
11
|
+
/** The sandbox allow-downloads attribute value */
|
|
12
|
+
readonly ALLOW_DOWNLOADS: "allow-downloads"
|
|
13
|
+
/** The sandbox allow-forms attribute value */
|
|
14
|
+
readonly ALLOW_FORMS: "allow-forms"
|
|
15
|
+
/** The sandbox allow-popups attribute value */
|
|
16
|
+
readonly ALLOW_POPUPS: "allow-popups"
|
|
17
|
+
};
|
|
18
|
+
export type BrowserPermission = typeof BrowserPermission[keyof typeof BrowserPermission];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAmBA,OAAO,cAAM;;UAEX,QAAQ;;UAER,YAAY;;UAEZ,UAAU;;UAEV,iBAAiB;;UAEjB,aAAa;;UAEb,cAAc;;AAEhB,YAAY,2BACH,+BAA+B","names":[],"sources":["../../src/permissions.ts"],"version":3,"file":"permissions.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/widget.api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-beta.1",
|
|
4
4
|
"description": "API contract between Foundry UIs that can embed custom widgets and the custom widgets themselves",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@osdk/api": "2.
|
|
32
|
+
"@osdk/api": "2.8.0-beta.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"ts-expect": "^1.3.0",
|
|
36
36
|
"typescript": "~5.5.4",
|
|
37
37
|
"vitest": "^3.2.4",
|
|
38
|
-
"@osdk/monorepo.
|
|
39
|
-
"@osdk/monorepo.
|
|
38
|
+
"@osdk/monorepo.api-extractor": "~0.7.0-beta.1",
|
|
39
|
+
"@osdk/monorepo.tsconfig": "~0.7.0-beta.1"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|