@osdk/widget.api 3.1.0-beta.2 → 3.1.0-beta.4
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 +12 -0
- package/build/browser/index.js +0 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/manifest.js.map +1 -1
- package/build/cjs/index.cjs +0 -4
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +25 -3
- package/build/esm/index.js +0 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/manifest.js.map +1 -1
- package/build/types/index.d.ts +1 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/manifest.d.ts +24 -0
- package/build/types/manifest.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/browser/metaTags.js +0 -18
- package/build/browser/metaTags.js.map +0 -1
- package/build/esm/metaTags.js +0 -18
- package/build/esm/metaTags.js.map +0 -1
- package/build/types/metaTags.d.ts +0 -1
- package/build/types/metaTags.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdk/widget.api
|
|
2
2
|
|
|
3
|
+
## 3.1.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3744571: Discover widget set input specs
|
|
8
|
+
|
|
9
|
+
## 3.1.0-beta.3
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- c09f545: Drop support for Sandbox v1 in widget client
|
|
14
|
+
|
|
3
15
|
## 3.1.0-beta.2
|
|
4
16
|
|
|
5
17
|
## 3.0.0-beta.6
|
package/build/browser/index.js
CHANGED
|
@@ -18,5 +18,4 @@ export { defineConfig } from "./config.js";
|
|
|
18
18
|
export { MANIFEST_FILE_LOCATION } from "./manifest.js";
|
|
19
19
|
export { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from "./messages/hostMessages.js";
|
|
20
20
|
export { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from "./messages/widgetMessages.js";
|
|
21
|
-
export { META_TAG_HOST_ORIGIN } from "./metaTags.js";
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","visitWidgetMessage"
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","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 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 visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { 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;;AAWA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,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 ParameterConfig,\n ParameterDefinition,\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\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, ParameterDefinition>;\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 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 ParameterConfig,\n ParameterDefinition,\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, ParameterDefinition>;\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;;AA+GA,OAAO,MAAMA,sBAAsB,GAAG,+BAA+B","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -49,11 +49,7 @@ function visitWidgetMessage(message, visitor) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
// src/metaTags.ts
|
|
53
|
-
var META_TAG_HOST_ORIGIN = "x-palantir-widgets-host-origin";
|
|
54
|
-
|
|
55
52
|
exports.MANIFEST_FILE_LOCATION = MANIFEST_FILE_LOCATION;
|
|
56
|
-
exports.META_TAG_HOST_ORIGIN = META_TAG_HOST_ORIGIN;
|
|
57
53
|
exports.defineConfig = defineConfig;
|
|
58
54
|
exports.isHostParametersUpdatedMessage = isHostParametersUpdatedMessage;
|
|
59
55
|
exports.isWidgetEmitEventMessage = isWidgetEmitEventMessage;
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config.ts","../../src/manifest.ts","../../src/messages/hostMessages.ts","../../src/messages/widgetMessages.ts"
|
|
1
|
+
{"version":3,"sources":["../../src/config.ts","../../src/manifest.ts","../../src/messages/hostMessages.ts","../../src/messages/widgetMessages.ts"],"names":["HostMessage"],"mappings":";;;AAqCO,SAAS,aAAa,CAAG,EAAA;AAC9B,EAAO,OAAA,CAAA;AACT;;;ACvBO,IAAM,sBAAyB,GAAA;;;ACA3BA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAgB,aAAa,OAAU,GAAA;AACzC,CAAG,EAAAA,mBAAA,KAAgBA,mBAAc,GAAA,EAAG,CAAA,CAAA;AAC7B,SAAS,+BAA+B,KAAO,EAAA;AACpD,EAAA,OAAO,MAAM,IAAS,KAAA,wBAAA;AACxB;AAIO,SAAS,gBAAA,CAAiB,SAAS,OAAS,EAAA;AACjD,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA;AAAA,GACE,GAAA,OAAA;AACJ,EAAM,MAAA,OAAA,GAAU,QAAQ,IAAI,CAAA;AAC5B,EAAA,IAAI,OAAS,EAAA;AAEX,IAAA,OAAA,CAAQ,OAAO,CAAA;AAAA,GACV,MAAA;AACL,IAAA,OAAA,CAAQ,SAAS,IAAI,CAAA;AAAA;AAEzB;;;ACrBO,SAAS,qBAAqB,KAAO,EAAA;AAC1C,EAAA,OAAO,MAAM,IAAS,KAAA,cAAA;AACxB;AACO,SAAS,yBAAyB,KAAO,EAAA;AAC9C,EAAA,OAAO,MAAM,IAAS,KAAA,mBAAA;AACxB;AACO,SAAS,kBAAA,CAAmB,SAAS,OAAS,EAAA;AACnD,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA;AAAA,GACE,GAAA,OAAA;AACJ,EAAM,MAAA,OAAA,GAAU,QAAQ,IAAI,CAAA;AAC5B,EAAA,IAAI,OAAS,EAAA;AAEX,IAAA,OAAA,CAAQ,OAAO,CAAA;AAAA,GACV,MAAA;AACL,IAAA,OAAA,CAAQ,SAAS,IAAI,CAAA;AAAA;AAEzB","file":"index.cjs","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\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\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 */\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\n\nexport function defineConfig(c) {\n return c;\n}","/*\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 const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";","/*\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// Interfaces and type guards for messages passed from the host Foundry UI to the widget\nexport let HostMessage;\n(function (_HostMessage) {\n const Version = _HostMessage.Version = \"1.0.0\";\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\n/**\n * Strongly typed visitor to handle every type of host message\n */\nexport function visitHostMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}","/*\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// Interfaces and type guards for messages passed from the widget to the host Foundry UI\nexport let WidgetMessage;\nexport function isWidgetReadyMessage(event) {\n return event.type === \"widget.ready\";\n}\nexport function isWidgetEmitEventMessage(event) {\n return event.type === \"widget.emit-event\";\n}\nexport function visitWidgetMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}"]}
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -163,6 +163,11 @@ interface WidgetSetManifestContentV1 {
|
|
|
163
163
|
* The key can be arbitrary, and is usually the name of your entrypoint, e.g. "main"
|
|
164
164
|
*/
|
|
165
165
|
widgets: Record<string, WidgetManifestConfigV1>;
|
|
166
|
+
/**
|
|
167
|
+
* The input specification for Foundry data required by the widget set.
|
|
168
|
+
* @optional
|
|
169
|
+
*/
|
|
170
|
+
inputSpec?: WidgetSetInputSpecV1;
|
|
166
171
|
}
|
|
167
172
|
interface WidgetManifestConfigV1 {
|
|
168
173
|
/**
|
|
@@ -207,6 +212,25 @@ interface WidgetManifestConfigV1 {
|
|
|
207
212
|
*/
|
|
208
213
|
events: Record<string, EventDefinition<ParameterConfig>>;
|
|
209
214
|
}
|
|
215
|
+
interface WidgetSetInputSpecV1 {
|
|
216
|
+
/**
|
|
217
|
+
* The input specification for the widget set that was automatically discovered from the project's dependencies.
|
|
218
|
+
* @optional
|
|
219
|
+
*/
|
|
220
|
+
discovered?: WidgetSetDiscoveredInputSpecV1;
|
|
221
|
+
}
|
|
222
|
+
interface WidgetSetDiscoveredInputSpecV1 {
|
|
223
|
+
/**
|
|
224
|
+
* The discovered Ontology SDK packages in the project's dependencies.
|
|
225
|
+
*/
|
|
226
|
+
sdks: Array<OntologySdkInputSpecV1>;
|
|
227
|
+
}
|
|
228
|
+
interface OntologySdkInputSpecV1 {
|
|
229
|
+
/** The Ontology SDK package rid */
|
|
230
|
+
rid: string;
|
|
231
|
+
/** The Ontology SDK package version */
|
|
232
|
+
version: string;
|
|
233
|
+
}
|
|
210
234
|
declare const MANIFEST_FILE_LOCATION = ".palantir/widgets.config.json";
|
|
211
235
|
|
|
212
236
|
interface HostBaseMessage<T extends string, P = unknown> {
|
|
@@ -284,6 +308,4 @@ type WidgetMessageVisitor<C extends WidgetConfig<C["parameters"]>> = {
|
|
|
284
308
|
};
|
|
285
309
|
declare function visitWidgetMessage<C extends WidgetConfig<C["parameters"]>>(message: WidgetMessage<C>, visitor: WidgetMessageVisitor<C>): void;
|
|
286
310
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
export { type AsyncFailedValue, type AsyncLoadedValue, type AsyncLoadingValue, type AsyncNotStartedLoadingValue, type AsyncParameterValueMap, type AsyncReloadingValue, type AsyncValue, type EventId, type EventParameterValueMap, HostMessage, MANIFEST_FILE_LOCATION, META_TAG_HOST_ORIGIN, type ParameterConfig, type ParameterDefinition, ParameterValue, type ParameterValueMap, type WidgetConfig, type WidgetManifestConfigV1 as WidgetManifestConfig, WidgetMessage, type WidgetSetManifestV1 as WidgetSetManifest, defineConfig, isHostParametersUpdatedMessage, isWidgetEmitEventMessage, isWidgetReadyMessage, visitHostMessage, visitWidgetMessage };
|
|
311
|
+
export { type AsyncFailedValue, type AsyncLoadedValue, type AsyncLoadingValue, type AsyncNotStartedLoadingValue, type AsyncParameterValueMap, type AsyncReloadingValue, type AsyncValue, type EventId, type EventParameterValueMap, HostMessage, MANIFEST_FILE_LOCATION, 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, visitHostMessage, visitWidgetMessage };
|
package/build/esm/index.js
CHANGED
|
@@ -18,5 +18,4 @@ export { defineConfig } from "./config.js";
|
|
|
18
18
|
export { MANIFEST_FILE_LOCATION } from "./manifest.js";
|
|
19
19
|
export { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from "./messages/hostMessages.js";
|
|
20
20
|
export { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from "./messages/widgetMessages.js";
|
|
21
|
-
export { META_TAG_HOST_ORIGIN } from "./metaTags.js";
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
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","visitWidgetMessage"
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineConfig","MANIFEST_FILE_LOCATION","HostMessage","isHostParametersUpdatedMessage","visitHostMessage","isWidgetEmitEventMessage","isWidgetReadyMessage","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 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 visitWidgetMessage,\n} from \"./messages/widgetMessages.js\";\nexport type { WidgetMessage } from \"./messages/widgetMessages.js\";\nexport type { 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;;AAWA,SAASA,YAAY,QAAQ,aAAa;AAQ1C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SACEC,WAAW,EACXC,8BAA8B,EAC9BC,gBAAgB,QACX,4BAA4B;AACnC,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,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 ParameterConfig,\n ParameterDefinition,\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\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, ParameterDefinition>;\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 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 ParameterConfig,\n ParameterDefinition,\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, ParameterDefinition>;\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;;AA+GA,OAAO,MAAMA,sBAAsB,GAAG,+BAA+B","ignoreList":[]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export type { AsyncParameterValueMap, EventId, EventParameterValueMap, ParameterConfig, ParameterDefinition, ParameterValueMap, WidgetConfig } from "./config.js";
|
|
2
2
|
export { defineConfig } from "./config.js";
|
|
3
|
-
export type { WidgetManifestConfigV1 as WidgetManifestConfig, WidgetSetManifestV1 as WidgetSetManifest } from "./manifest.js";
|
|
3
|
+
export type { OntologySdkInputSpecV1 as OntologySdkInputSpec, WidgetManifestConfigV1 as WidgetManifestConfig, WidgetSetDiscoveredInputSpecV1 as WidgetSetDiscoveredInputSpec, WidgetSetInputSpecV1 as WidgetSetInputSpec, WidgetSetManifestV1 as WidgetSetManifest } from "./manifest.js";
|
|
4
4
|
export { MANIFEST_FILE_LOCATION } from "./manifest.js";
|
|
5
5
|
export { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from "./messages/hostMessages.js";
|
|
6
6
|
export { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from "./messages/widgetMessages.js";
|
|
7
7
|
export type { WidgetMessage } from "./messages/widgetMessages.js";
|
|
8
|
-
export { META_TAG_HOST_ORIGIN } from "./metaTags.js";
|
|
9
8
|
export type { ParameterValue } from "./parameters.js";
|
|
10
9
|
export type { AsyncFailedValue, AsyncLoadedValue, AsyncLoadingValue, AsyncNotStartedLoadingValue, AsyncReloadingValue, AsyncValue } from "./utils/asyncValue.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,wBACA,SACA,wBACA,iBACA,qBACA,mBACA,oBACK;AACP,SAAS,oBAAoB;AAC7B,cACE,0BAA0B,sBAC1B,uBAAuB,yBAClB;AACP,SAAS,8BAA8B;AACvC,SACE,aACA,gCACA,wBACK;AACP,SACE,0BACA,sBACA,0BACK;AACP,cAAc,qBAAqB;AACnC,
|
|
1
|
+
{"mappings":"AAgBA,cACE,wBACA,SACA,wBACA,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,0BACK;AACP,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cACE,kBACA,kBACA,mBACA,6BACA,qBACA,kBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -17,6 +17,11 @@ export interface WidgetSetManifestContentV1 {
|
|
|
17
17
|
* The key can be arbitrary, and is usually the name of your entrypoint, e.g. "main"
|
|
18
18
|
*/
|
|
19
19
|
widgets: Record<string, WidgetManifestConfigV1>;
|
|
20
|
+
/**
|
|
21
|
+
* The input specification for Foundry data required by the widget set.
|
|
22
|
+
* @optional
|
|
23
|
+
*/
|
|
24
|
+
inputSpec?: WidgetSetInputSpecV1;
|
|
20
25
|
}
|
|
21
26
|
export interface WidgetManifestConfigV1 {
|
|
22
27
|
/**
|
|
@@ -61,4 +66,23 @@ export interface WidgetManifestConfigV1 {
|
|
|
61
66
|
*/
|
|
62
67
|
events: Record<string, EventDefinition<ParameterConfig>>;
|
|
63
68
|
}
|
|
69
|
+
export interface WidgetSetInputSpecV1 {
|
|
70
|
+
/**
|
|
71
|
+
* The input specification for the widget set that was automatically discovered from the project's dependencies.
|
|
72
|
+
* @optional
|
|
73
|
+
*/
|
|
74
|
+
discovered?: WidgetSetDiscoveredInputSpecV1;
|
|
75
|
+
}
|
|
76
|
+
export interface WidgetSetDiscoveredInputSpecV1 {
|
|
77
|
+
/**
|
|
78
|
+
* The discovered Ontology SDK packages in the project's dependencies.
|
|
79
|
+
*/
|
|
80
|
+
sdks: Array<OntologySdkInputSpecV1>;
|
|
81
|
+
}
|
|
82
|
+
export interface OntologySdkInputSpecV1 {
|
|
83
|
+
/** The Ontology SDK package rid */
|
|
84
|
+
rid: string;
|
|
85
|
+
/** The Ontology SDK package version */
|
|
86
|
+
version: string;
|
|
87
|
+
}
|
|
64
88
|
export declare const MANIFEST_FILE_LOCATION = ".palantir/widgets.config.json";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,iBACA,iBACA,2BACK,aAAc;AAErB,iBAAiB,oBAAoB;CACnC,iBAAiB;CACjB,WAAW;AACZ;AAED,iBAAiB,2BAA2B;;;;CAI1C;;;;CAKA;;;;;CAMA,SAAS,eAAe;
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,iBACA,2BACK,aAAc;AAErB,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;AACxC;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"}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 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
|
-
export const META_TAG_HOST_ORIGIN = "x-palantir-widgets-host-origin";
|
|
18
|
-
//# sourceMappingURL=metaTags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metaTags.js","names":["META_TAG_HOST_ORIGIN"],"sources":["metaTags.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 const META_TAG_HOST_ORIGIN = \"x-palantir-widgets-host-origin\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,oBAAoB,GAAG,gCAAgC","ignoreList":[]}
|
package/build/esm/metaTags.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 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
|
-
export const META_TAG_HOST_ORIGIN = "x-palantir-widgets-host-origin";
|
|
18
|
-
//# sourceMappingURL=metaTags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metaTags.js","names":["META_TAG_HOST_ORIGIN"],"sources":["metaTags.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 const META_TAG_HOST_ORIGIN = \"x-palantir-widgets-host-origin\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,oBAAoB,GAAG,gCAAgC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const META_TAG_HOST_ORIGIN = "x-palantir-widgets-host-origin";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAgBA,OAAO,cAAM,uBAAuB","names":[],"sources":["../../src/metaTags.ts"],"version":3,"file":"metaTags.d.ts"}
|