@ethisyscore/plugin-ui 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var plugin = require('@ethisyscore/extension-runtime/plugin');
5
+
6
+ // src/a11y/useA11yAnnounce.ts
7
+ function useA11yAnnounce(politeness = "polite") {
8
+ const client = plugin.useBridgeClient();
9
+ return react.useCallback(
10
+ (message) => client.announceA11y(message, politeness),
11
+ [client, politeness]
12
+ );
13
+ }
14
+
15
+ exports.useA11yAnnounce = useA11yAnnounce;
16
+ //# sourceMappingURL=index.cjs.map
17
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/a11y/useA11yAnnounce.ts"],"names":["useBridgeClient","useCallback"],"mappings":";;;;;;AAcO,SAAS,eAAA,CACd,aAAqC,QAAA,EACV;AAC3B,EAAA,MAAM,SAASA,sBAAA,EAAgB;AAC/B,EAAA,OAAOC,iBAAA;AAAA,IACL,CAAC,OAAA,KAAoB,MAAA,CAAO,YAAA,CAAa,SAAS,UAAU,CAAA;AAAA,IAC5D,CAAC,QAAQ,UAAU;AAAA,GACrB;AACF","file":"index.cjs","sourcesContent":["import { useCallback } from \"react\";\nimport { useBridgeClient } from \"@ethisyscore/extension-runtime/plugin\";\n\n/**\n * Returns a stable callback that asks the host to make a live-region\n * announcement on behalf of the plugin.\n *\n * Prefer this over writing to the DOM directly — the host manages ARIA live\n * regions centrally so announcements from different plugins don't clobber\n * each other.\n *\n * @param politeness \"polite\" (default) or \"assertive\". Use \"assertive\" for\n * critical errors only — it interrupts screen reader speech immediately.\n */\nexport function useA11yAnnounce(\n politeness: \"polite\" | \"assertive\" = \"polite\",\n): (message: string) => void {\n const client = useBridgeClient();\n return useCallback(\n (message: string) => client.announceA11y(message, politeness),\n [client, politeness],\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns a stable callback that asks the host to make a live-region
3
+ * announcement on behalf of the plugin.
4
+ *
5
+ * Prefer this over writing to the DOM directly — the host manages ARIA live
6
+ * regions centrally so announcements from different plugins don't clobber
7
+ * each other.
8
+ *
9
+ * @param politeness "polite" (default) or "assertive". Use "assertive" for
10
+ * critical errors only — it interrupts screen reader speech immediately.
11
+ */
12
+ declare function useA11yAnnounce(politeness?: "polite" | "assertive"): (message: string) => void;
13
+
14
+ export { useA11yAnnounce };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns a stable callback that asks the host to make a live-region
3
+ * announcement on behalf of the plugin.
4
+ *
5
+ * Prefer this over writing to the DOM directly — the host manages ARIA live
6
+ * regions centrally so announcements from different plugins don't clobber
7
+ * each other.
8
+ *
9
+ * @param politeness "polite" (default) or "assertive". Use "assertive" for
10
+ * critical errors only — it interrupts screen reader speech immediately.
11
+ */
12
+ declare function useA11yAnnounce(politeness?: "polite" | "assertive"): (message: string) => void;
13
+
14
+ export { useA11yAnnounce };
@@ -0,0 +1,15 @@
1
+ import { useCallback } from 'react';
2
+ import { useBridgeClient } from '@ethisyscore/extension-runtime/plugin';
3
+
4
+ // src/a11y/useA11yAnnounce.ts
5
+ function useA11yAnnounce(politeness = "polite") {
6
+ const client = useBridgeClient();
7
+ return useCallback(
8
+ (message) => client.announceA11y(message, politeness),
9
+ [client, politeness]
10
+ );
11
+ }
12
+
13
+ export { useA11yAnnounce };
14
+ //# sourceMappingURL=index.js.map
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/a11y/useA11yAnnounce.ts"],"names":[],"mappings":";;;;AAcO,SAAS,eAAA,CACd,aAAqC,QAAA,EACV;AAC3B,EAAA,MAAM,SAAS,eAAA,EAAgB;AAC/B,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,OAAA,KAAoB,MAAA,CAAO,YAAA,CAAa,SAAS,UAAU,CAAA;AAAA,IAC5D,CAAC,QAAQ,UAAU;AAAA,GACrB;AACF","file":"index.js","sourcesContent":["import { useCallback } from \"react\";\nimport { useBridgeClient } from \"@ethisyscore/extension-runtime/plugin\";\n\n/**\n * Returns a stable callback that asks the host to make a live-region\n * announcement on behalf of the plugin.\n *\n * Prefer this over writing to the DOM directly — the host manages ARIA live\n * regions centrally so announcements from different plugins don't clobber\n * each other.\n *\n * @param politeness \"polite\" (default) or \"assertive\". Use \"assertive\" for\n * critical errors only — it interrupts screen reader speech immediately.\n */\nexport function useA11yAnnounce(\n politeness: \"polite\" | \"assertive\" = \"polite\",\n): (message: string) => void {\n const client = useBridgeClient();\n return useCallback(\n (message: string) => client.announceA11y(message, politeness),\n [client, politeness],\n );\n}\n"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var plugin = require('@ethisyscore/extension-runtime/plugin');
4
+ var componentsReact = require('@ethisyscore/components-react');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "BridgeClientContext", {
9
+ enumerable: true,
10
+ get: function () { return plugin.BridgeClientContext; }
11
+ });
12
+ Object.defineProperty(exports, "ExtensionRuntimeProvider", {
13
+ enumerable: true,
14
+ get: function () { return plugin.ExtensionRuntimeProvider; }
15
+ });
16
+ Object.defineProperty(exports, "createPortBridgeClient", {
17
+ enumerable: true,
18
+ get: function () { return plugin.createPortBridgeClient; }
19
+ });
20
+ Object.defineProperty(exports, "unwrapItems", {
21
+ enumerable: true,
22
+ get: function () { return plugin.unwrapItems; }
23
+ });
24
+ Object.defineProperty(exports, "useBridgeClient", {
25
+ enumerable: true,
26
+ get: function () { return plugin.useBridgeClient; }
27
+ });
28
+ Object.defineProperty(exports, "useBridgeLocale", {
29
+ enumerable: true,
30
+ get: function () { return plugin.useBridgeLocale; }
31
+ });
32
+ Object.defineProperty(exports, "useBridgeTheme", {
33
+ enumerable: true,
34
+ get: function () { return plugin.useBridgeTheme; }
35
+ });
36
+ Object.defineProperty(exports, "useMcpQuery", {
37
+ enumerable: true,
38
+ get: function () { return plugin.useMcpQuery; }
39
+ });
40
+ Object.defineProperty(exports, "useMcpResource", {
41
+ enumerable: true,
42
+ get: function () { return plugin.useMcpResource; }
43
+ });
44
+ Object.defineProperty(exports, "useMcpTool", {
45
+ enumerable: true,
46
+ get: function () { return plugin.useMcpTool; }
47
+ });
48
+ Object.defineProperty(exports, "definePlatformReactPage", {
49
+ enumerable: true,
50
+ get: function () { return componentsReact.definePlatformReactPage; }
51
+ });
52
+ Object.defineProperty(exports, "emitNavigation", {
53
+ enumerable: true,
54
+ get: function () { return componentsReact.emitNavigation; }
55
+ });
56
+ //# sourceMappingURL=index.cjs.map
57
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ export { A11yPayload, BridgeClientContext, BridgePortShim, DensityPayload, ExtensionRuntimeProvider, ExtensionRuntimeProviderProps, ItemsResponse, LocalePayload, McpTransport, NavPayload, PortBridgeClient, SessionTokenPayload, ThemePayload, UseMcpQueryOptions, UseMcpQueryResult, UseMcpResourceOptions, UseMcpResourceResult, UseMcpToolOptions, UseMcpToolResult, createPortBridgeClient, unwrapItems, useBridgeClient, useBridgeLocale, useBridgeTheme, useMcpQuery, useMcpResource, useMcpTool } from '@ethisyscore/extension-runtime/plugin';
2
+ export { PlatformReactPageProps, definePlatformReactPage, emitNavigation } from '@ethisyscore/components-react';
@@ -0,0 +1,2 @@
1
+ export { A11yPayload, BridgeClientContext, BridgePortShim, DensityPayload, ExtensionRuntimeProvider, ExtensionRuntimeProviderProps, ItemsResponse, LocalePayload, McpTransport, NavPayload, PortBridgeClient, SessionTokenPayload, ThemePayload, UseMcpQueryOptions, UseMcpQueryResult, UseMcpResourceOptions, UseMcpResourceResult, UseMcpToolOptions, UseMcpToolResult, createPortBridgeClient, unwrapItems, useBridgeClient, useBridgeLocale, useBridgeTheme, useMcpQuery, useMcpResource, useMcpTool } from '@ethisyscore/extension-runtime/plugin';
2
+ export { PlatformReactPageProps, definePlatformReactPage, emitNavigation } from '@ethisyscore/components-react';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { BridgeClientContext, ExtensionRuntimeProvider, createPortBridgeClient, unwrapItems, useBridgeClient, useBridgeLocale, useBridgeTheme, useMcpQuery, useMcpResource, useMcpTool } from '@ethisyscore/extension-runtime/plugin';
2
+ export { definePlatformReactPage, emitNavigation } from '@ethisyscore/components-react';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var plugin = require('@ethisyscore/extension-runtime/plugin');
4
+
5
+ // src/l10n/usePluginLocale.ts
6
+ function usePluginLocale(fallbackLocale = "en-US") {
7
+ const pushed = plugin.useBridgeLocale();
8
+ if (pushed === void 0) {
9
+ return { locale: fallbackLocale, dir: "ltr" };
10
+ }
11
+ return { locale: pushed.locale, dir: pushed.dir };
12
+ }
13
+
14
+ exports.usePluginLocale = usePluginLocale;
15
+ //# sourceMappingURL=index.cjs.map
16
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/l10n/usePluginLocale.ts"],"names":["useBridgeLocale"],"mappings":";;;;;AAkBO,SAAS,eAAA,CAAgB,iBAAiB,OAAA,EAAuB;AACtE,EAAA,MAAM,SAASA,sBAAA,EAAgB;AAC/B,EAAA,IAAI,WAAW,MAAA,EAAW;AACxB,IAAA,OAAO,EAAE,MAAA,EAAQ,cAAA,EAAgB,GAAA,EAAK,KAAA,EAAM;AAAA,EAC9C;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAQ,GAAA,EAAK,OAAO,GAAA,EAAI;AAClD","file":"index.cjs","sourcesContent":["import { useBridgeLocale } from \"@ethisyscore/extension-runtime/plugin\";\n\nexport interface PluginLocale {\n /** BCP 47 tag, e.g. \"en-GB\". Falls back to the supplied `fallbackLocale`. */\n locale: string;\n /** \"ltr\" | \"rtl\" — derived from the host locale push. */\n dir: \"ltr\" | \"rtl\";\n}\n\n/**\n * Returns the current locale and text direction as pushed by the host.\n *\n * Before the host sends the first `BRIDGE_PUSH_LOCALE` message (e.g. during\n * SSR or very early render), returns the `fallbackLocale` (default `\"en-US\"`)\n * with `dir: \"ltr\"`.\n *\n * @param fallbackLocale BCP 47 tag to use before the first locale push.\n */\nexport function usePluginLocale(fallbackLocale = \"en-US\"): PluginLocale {\n const pushed = useBridgeLocale();\n if (pushed === undefined) {\n return { locale: fallbackLocale, dir: \"ltr\" };\n }\n return { locale: pushed.locale, dir: pushed.dir };\n}\n"]}
@@ -0,0 +1,18 @@
1
+ interface PluginLocale {
2
+ /** BCP 47 tag, e.g. "en-GB". Falls back to the supplied `fallbackLocale`. */
3
+ locale: string;
4
+ /** "ltr" | "rtl" — derived from the host locale push. */
5
+ dir: "ltr" | "rtl";
6
+ }
7
+ /**
8
+ * Returns the current locale and text direction as pushed by the host.
9
+ *
10
+ * Before the host sends the first `BRIDGE_PUSH_LOCALE` message (e.g. during
11
+ * SSR or very early render), returns the `fallbackLocale` (default `"en-US"`)
12
+ * with `dir: "ltr"`.
13
+ *
14
+ * @param fallbackLocale BCP 47 tag to use before the first locale push.
15
+ */
16
+ declare function usePluginLocale(fallbackLocale?: string): PluginLocale;
17
+
18
+ export { type PluginLocale, usePluginLocale };
@@ -0,0 +1,18 @@
1
+ interface PluginLocale {
2
+ /** BCP 47 tag, e.g. "en-GB". Falls back to the supplied `fallbackLocale`. */
3
+ locale: string;
4
+ /** "ltr" | "rtl" — derived from the host locale push. */
5
+ dir: "ltr" | "rtl";
6
+ }
7
+ /**
8
+ * Returns the current locale and text direction as pushed by the host.
9
+ *
10
+ * Before the host sends the first `BRIDGE_PUSH_LOCALE` message (e.g. during
11
+ * SSR or very early render), returns the `fallbackLocale` (default `"en-US"`)
12
+ * with `dir: "ltr"`.
13
+ *
14
+ * @param fallbackLocale BCP 47 tag to use before the first locale push.
15
+ */
16
+ declare function usePluginLocale(fallbackLocale?: string): PluginLocale;
17
+
18
+ export { type PluginLocale, usePluginLocale };
@@ -0,0 +1,14 @@
1
+ import { useBridgeLocale } from '@ethisyscore/extension-runtime/plugin';
2
+
3
+ // src/l10n/usePluginLocale.ts
4
+ function usePluginLocale(fallbackLocale = "en-US") {
5
+ const pushed = useBridgeLocale();
6
+ if (pushed === void 0) {
7
+ return { locale: fallbackLocale, dir: "ltr" };
8
+ }
9
+ return { locale: pushed.locale, dir: pushed.dir };
10
+ }
11
+
12
+ export { usePluginLocale };
13
+ //# sourceMappingURL=index.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/l10n/usePluginLocale.ts"],"names":[],"mappings":";;;AAkBO,SAAS,eAAA,CAAgB,iBAAiB,OAAA,EAAuB;AACtE,EAAA,MAAM,SAAS,eAAA,EAAgB;AAC/B,EAAA,IAAI,WAAW,MAAA,EAAW;AACxB,IAAA,OAAO,EAAE,MAAA,EAAQ,cAAA,EAAgB,GAAA,EAAK,KAAA,EAAM;AAAA,EAC9C;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAQ,GAAA,EAAK,OAAO,GAAA,EAAI;AAClD","file":"index.js","sourcesContent":["import { useBridgeLocale } from \"@ethisyscore/extension-runtime/plugin\";\n\nexport interface PluginLocale {\n /** BCP 47 tag, e.g. \"en-GB\". Falls back to the supplied `fallbackLocale`. */\n locale: string;\n /** \"ltr\" | \"rtl\" — derived from the host locale push. */\n dir: \"ltr\" | \"rtl\";\n}\n\n/**\n * Returns the current locale and text direction as pushed by the host.\n *\n * Before the host sends the first `BRIDGE_PUSH_LOCALE` message (e.g. during\n * SSR or very early render), returns the `fallbackLocale` (default `\"en-US\"`)\n * with `dir: \"ltr\"`.\n *\n * @param fallbackLocale BCP 47 tag to use before the first locale push.\n */\nexport function usePluginLocale(fallbackLocale = \"en-US\"): PluginLocale {\n const pushed = useBridgeLocale();\n if (pushed === undefined) {\n return { locale: fallbackLocale, dir: \"ltr\" };\n }\n return { locale: pushed.locale, dir: pushed.dir };\n}\n"]}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var plugin = require('@ethisyscore/extension-runtime/plugin');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "useFrontendSessionToken", {
8
+ enumerable: true,
9
+ get: function () { return plugin.useFrontendSessionToken; }
10
+ });
11
+ //# sourceMappingURL=index.cjs.map
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
@@ -0,0 +1 @@
1
+ export { UseFrontendSessionTokenResult, useFrontendSessionToken } from '@ethisyscore/extension-runtime/plugin';
@@ -0,0 +1 @@
1
+ export { UseFrontendSessionTokenResult, useFrontendSessionToken } from '@ethisyscore/extension-runtime/plugin';
@@ -0,0 +1,3 @@
1
+ export { useFrontendSessionToken } from '@ethisyscore/extension-runtime/plugin';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@ethisyscore/plugin-ui",
3
+ "version": "1.10.0",
4
+ "description": "Plugin-UI umbrella SDK: client bridge + a11y/l10n primitives + brokered-MCP client (WI 4858).",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./a11y": {
16
+ "types": "./dist/a11y/index.d.ts",
17
+ "import": "./dist/a11y/index.js",
18
+ "require": "./dist/a11y/index.cjs"
19
+ },
20
+ "./l10n": {
21
+ "types": "./dist/l10n/index.d.ts",
22
+ "import": "./dist/l10n/index.js",
23
+ "require": "./dist/l10n/index.cjs"
24
+ },
25
+ "./token": {
26
+ "types": "./dist/token/index.d.ts",
27
+ "import": "./dist/token/index.js",
28
+ "require": "./dist/token/index.cjs"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "scripts": {
37
+ "build": "tsup",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest",
40
+ "lint": "tsc --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@ethisyscore/components-react": "^1.10.0",
44
+ "@ethisyscore/extension-runtime": "^1.10.0"
45
+ },
46
+ "peerDependencies": {
47
+ "react": ">=18"
48
+ },
49
+ "devDependencies": {
50
+ "@testing-library/jest-dom": "^6.6.0",
51
+ "@testing-library/react": "^16.0.0",
52
+ "@types/node": "^20.19.41",
53
+ "@types/react": "^18.3.0",
54
+ "@types/react-dom": "^18.3.0",
55
+ "jsdom": "^25.0.0",
56
+ "react": "^18.3.0",
57
+ "react-dom": "^18.3.0",
58
+ "tsup": "^8.5.0",
59
+ "typescript": "^5.9.0",
60
+ "vitest": "^4.1.0"
61
+ },
62
+ "engines": {
63
+ "node": ">=20"
64
+ },
65
+ "keywords": [
66
+ "ethisyscore",
67
+ "plugin",
68
+ "bridge",
69
+ "sdk",
70
+ "4858"
71
+ ],
72
+ "license": "Apache-2.0"
73
+ }