@intlayer/design-system 9.5.3 → 9.5.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.
Files changed (58) hide show
  1. package/README.md +6 -6
  2. package/dist/esm/api/useAuth/useOAuth2.mjs +1 -1
  3. package/dist/esm/api/useAuth/useSession.mjs +2 -2
  4. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +6 -6
  5. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
  6. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +11 -11
  7. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  8. package/dist/esm/components/Form/FormBase.mjs +17 -3
  9. package/dist/esm/components/Form/FormBase.mjs.map +1 -1
  10. package/dist/esm/components/Form/elements/FormElement.mjs +4 -1
  11. package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
  12. package/dist/esm/components/Form/elements/FormElementWrapper.mjs +2 -2
  13. package/dist/esm/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  14. package/dist/esm/components/Form/index.mjs +2 -2
  15. package/dist/esm/components/Status/index.mjs +2 -5
  16. package/dist/esm/components/Status/index.mjs.map +1 -1
  17. package/dist/esm/components/index.mjs +2 -2
  18. package/dist/esm/hooks/index.mjs +10 -8
  19. package/dist/esm/hooks/useRemoteMcpTools.mjs +56 -0
  20. package/dist/esm/hooks/useRemoteMcpTools.mjs.map +1 -0
  21. package/dist/esm/hooks/useWebMCPTools.mjs +44 -0
  22. package/dist/esm/hooks/useWebMCPTools.mjs.map +1 -0
  23. package/dist/esm/providers/index.mjs +1 -1
  24. package/dist/esm/structured-data/index.mjs +6 -6
  25. package/dist/esm/webmcp/createRemoteMcpTools.mjs +65 -0
  26. package/dist/esm/webmcp/createRemoteMcpTools.mjs.map +1 -0
  27. package/dist/esm/webmcp/getModelContext.mjs +28 -0
  28. package/dist/esm/webmcp/getModelContext.mjs.map +1 -0
  29. package/dist/esm/webmcp/index.mjs +5 -0
  30. package/dist/esm/webmcp/registerWebMCPTools.mjs +54 -0
  31. package/dist/esm/webmcp/registerWebMCPTools.mjs.map +1 -0
  32. package/dist/esm/webmcp/types.mjs +0 -0
  33. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +7 -7
  34. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
  35. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +10 -10
  36. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  37. package/dist/types/components/Form/FormBase.d.ts +27 -4
  38. package/dist/types/components/Form/FormBase.d.ts.map +1 -1
  39. package/dist/types/components/Form/elements/FormElement.d.ts +1 -0
  40. package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
  41. package/dist/types/components/Form/elements/FormElementWrapper.d.ts +3 -3
  42. package/dist/types/components/Form/index.d.ts +2 -2
  43. package/dist/types/components/index.d.ts +2 -2
  44. package/dist/types/hooks/index.d.ts +3 -1
  45. package/dist/types/hooks/useRemoteMcpTools.d.ts +18 -0
  46. package/dist/types/hooks/useRemoteMcpTools.d.ts.map +1 -0
  47. package/dist/types/hooks/useWebMCPTools.d.ts +22 -0
  48. package/dist/types/hooks/useWebMCPTools.d.ts.map +1 -0
  49. package/dist/types/webmcp/createRemoteMcpTools.d.ts +52 -0
  50. package/dist/types/webmcp/createRemoteMcpTools.d.ts.map +1 -0
  51. package/dist/types/webmcp/getModelContext.d.ts +18 -0
  52. package/dist/types/webmcp/getModelContext.d.ts.map +1 -0
  53. package/dist/types/webmcp/index.d.ts +5 -0
  54. package/dist/types/webmcp/registerWebMCPTools.d.ts +19 -0
  55. package/dist/types/webmcp/registerWebMCPTools.d.ts.map +1 -0
  56. package/dist/types/webmcp/types.d.ts +74 -0
  57. package/dist/types/webmcp/types.d.ts.map +1 -0
  58. package/package.json +33 -27
@@ -0,0 +1,74 @@
1
+ //#region src/webmcp/types.d.ts
2
+ /**
3
+ * Minimal typings for the WebMCP browser API.
4
+ *
5
+ * The API is still evolving: Chrome's early preview exposes
6
+ * `navigator.modelContext` (with `registerTool` / `unregisterTool` /
7
+ * `provideContext` / `clearContext`), the `chrome://flags/#enable-webmcp-testing`
8
+ * flag adds `navigator.modelContextTesting`, and the W3C draft moves the entry
9
+ * point to `document.modelContext` with an `AbortSignal` based unregistration.
10
+ * Every member is optional so a single adapter can drive all three shapes.
11
+ *
12
+ * @see https://webmachinelearning.github.io/webmcp/
13
+ */
14
+ /** JSON Schema describing a tool's input object. */
15
+ export type WebMCPJsonSchema = Record<string, unknown>;
16
+ /**
17
+ * Hints letting an agent decide whether a call needs user confirmation.
18
+ *
19
+ * `readOnlyHint`, `untrustedContentHint` and `consequentialHint` are the
20
+ * WebMCP ones; the rest mirror MCP tool annotations so a bridged MCP tool
21
+ * keeps its hints.
22
+ */
23
+ export type WebMCPToolAnnotations = {
24
+ /** The tool does not modify anything. */
25
+ readOnlyHint?: boolean;
26
+ /** The result carries content the page does not control (user data, remote text). */
27
+ untrustedContentHint?: boolean;
28
+ /** The tool performs an action that is hard to undo. */
29
+ consequentialHint?: boolean;
30
+ /** The tool may delete or irreversibly alter data (MCP). */
31
+ destructiveHint?: boolean;
32
+ /** Repeating the call with the same input has no additional effect (MCP). */
33
+ idempotentHint?: boolean;
34
+ /** The tool reaches beyond the page, e.g. a third-party website (MCP). */
35
+ openWorldHint?: boolean;
36
+ };
37
+ export type WebMCPToolExecuteOptions = {
38
+ signal?: AbortSignal;
39
+ };
40
+ /**
41
+ * The value returned by a tool. Strings are handed to the agent verbatim,
42
+ * anything else is JSON-serialized by the browser.
43
+ */
44
+ export type WebMCPToolResult = string | Record<string, unknown> | unknown[];
45
+ /** A tool an agent can invoke through the WebMCP browser API. */
46
+ export type WebMCPTool<TInput = Record<string, unknown>> = {
47
+ /** 1–128 chars, ASCII alphanumeric plus `_`, `-` and `.`. */
48
+ name: string;
49
+ title?: string;
50
+ description: string;
51
+ inputSchema?: WebMCPJsonSchema;
52
+ annotations?: WebMCPToolAnnotations;
53
+ execute: (input: TInput, options?: WebMCPToolExecuteOptions) => Promise<WebMCPToolResult> | WebMCPToolResult;
54
+ };
55
+ export type WebMCPRegisterToolOptions = {
56
+ /** Aborting unregisters the tool (W3C draft shape). */
57
+ signal?: AbortSignal;
58
+ };
59
+ /** The subset of the `ModelContext` interface this package relies on. */
60
+ export type ModelContext = {
61
+ registerTool?: (tool: WebMCPTool<never>, options?: WebMCPRegisterToolOptions) => void | Promise<void>;
62
+ unregisterTool?: (name: string) => void | Promise<void>;
63
+ provideContext?: (context: {
64
+ tools: WebMCPTool<never>[];
65
+ }) => void;
66
+ clearContext?: () => void;
67
+ };
68
+ /** `Navigator` and `Document` as extended by the WebMCP proposals. */
69
+ export type ModelContextHost = {
70
+ modelContextTesting?: ModelContext;
71
+ modelContext?: ModelContext;
72
+ };
73
+ //#endregion
74
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/webmcp/types.ts"],"mappings":";;;;;;;;;;;;;;YAcY,mBAAmB;;;;;;;;YASnB;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;YAGU;EACV,SAAS;;;;;;YAOC,4BAA4B;;YAG5B,WAAW,SAAS;;EAE9B;EACA;EACA;EACA,cAAc;EACd,cAAc;EACd,UACE,OAAO,QACP,UAAU,6BACP,QAAQ,oBAAoB;;YAGvB;;EAEV,SAAS;;;YAIC;EACV,gBACE,MAAM,mBACN,UAAU,qCACA;EACZ,kBAAkB,wBAAwB;EAC1C,kBAAkB;IAAW,OAAO;;EACpC;;;YAIU;EACV,sBAAsB;EACtB,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/design-system",
3
- "version": "9.5.3",
3
+ "version": "9.5.4",
4
4
  "private": false,
5
5
  "description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
6
6
  "keywords": [
@@ -68,6 +68,11 @@
68
68
  "import": "./dist/esm/routes.mjs",
69
69
  "default": "./dist/esm/routes.mjs"
70
70
  },
71
+ "./webmcp": {
72
+ "types": "./dist/types/webmcp/index.d.ts",
73
+ "import": "./dist/esm/webmcp/index.mjs",
74
+ "default": "./dist/esm/webmcp/index.mjs"
75
+ },
71
76
  "./structured-data": {
72
77
  "types": "./dist/types/structured-data/index.d.ts",
73
78
  "import": "./dist/esm/structured-data/index.mjs",
@@ -444,6 +449,7 @@
444
449
  "preview": "bun --bun vite preview",
445
450
  "publish": "bun publish || true",
446
451
  "publish:canary": "bun publish --access public --tag canary || true",
452
+ "publish:ci": "bun ../../../scripts/publish-package.mjs",
447
453
  "publish:latest": "bun publish --access public --tag latest || true",
448
454
  "start": "bun storybook -p 6006 --no-open --host 0.0.0.0",
449
455
  "start:serve": "bun x serve ./storybook-static -l 6006",
@@ -455,22 +461,22 @@
455
461
  "typecheck_": "tsc --noEmit --project tsconfig.types.json"
456
462
  },
457
463
  "dependencies": {
458
- "@better-auth/passkey": "1.7.4",
459
- "@better-auth/sso": "1.7.4",
460
- "@intlayer/api": "9.5.3",
461
- "@intlayer/config": "9.5.3",
462
- "@intlayer/core": "9.5.3",
463
- "@intlayer/dictionaries-entry": "9.5.3",
464
- "@intlayer/editor-react": "9.5.3",
465
- "@intlayer/engine": "9.5.3",
466
- "@intlayer/types": "9.5.3",
464
+ "@better-auth/passkey": "1.7.5",
465
+ "@better-auth/sso": "1.7.5",
466
+ "@intlayer/api": "9.5.4",
467
+ "@intlayer/config": "9.5.4",
468
+ "@intlayer/core": "9.5.4",
469
+ "@intlayer/dictionaries-entry": "9.5.4",
470
+ "@intlayer/editor-react": "9.5.4",
471
+ "@intlayer/engine": "9.5.4",
472
+ "@intlayer/types": "9.5.4",
467
473
  "@radix-ui/react-dialog": "1.1.23",
468
474
  "@radix-ui/react-select": "2.3.7",
469
475
  "@radix-ui/react-slot": "1.3.3",
470
476
  "@radix-ui/react-toast": "1.2.23",
471
477
  "@tailwindcss/aspect-ratio": "0.4.2",
472
- "@tanstack/query-async-storage-persister": "5.102.8",
473
- "@tanstack/react-query-persist-client": "5.102.8",
478
+ "@tanstack/query-async-storage-persister": "5.103.1",
479
+ "@tanstack/react-query-persist-client": "5.103.1",
474
480
  "@tanstack/react-virtual": "3.14.13",
475
481
  "@tiptap/core": "3.31.3",
476
482
  "@tiptap/extension-character-count": "3.31.3",
@@ -490,14 +496,14 @@
490
496
  "@tiptap/react": "3.31.3",
491
497
  "@tiptap/starter-kit": "3.31.3",
492
498
  "@tiptap/suggestion": "3.31.3",
493
- "better-auth": "1.7.4",
499
+ "better-auth": "1.7.5",
494
500
  "class-variance-authority": "0.7.1",
495
501
  "cmdk": "1.1.1",
496
502
  "cnfast": "0.2.0",
497
503
  "defu": "6.1.7",
498
504
  "dompurify": "3.4.15",
499
- "isomorphic-dompurify": "4.1.0",
500
- "react-intlayer": "9.5.3",
505
+ "isomorphic-dompurify": "4.2.0",
506
+ "react-intlayer": "9.5.4",
501
507
  "rollup-preserve-directives": "1.1.3",
502
508
  "tiptap-extension-global-drag-handle": "^0.1.18",
503
509
  "tiptap-markdown": "^0.9.0",
@@ -505,7 +511,7 @@
505
511
  "zod": "4.6.5"
506
512
  },
507
513
  "devDependencies": {
508
- "@intlayer/backend": "9.5.3",
514
+ "@intlayer/backend": "9.5.4",
509
515
  "@shikijs/core": "4.4.3",
510
516
  "@shikijs/engine-oniguruma": "4.4.3",
511
517
  "@shikijs/transformers": "4.4.3",
@@ -532,35 +538,35 @@
532
538
  "@utils/ts-config": "1.0.4",
533
539
  "@utils/ts-config-types": "1.0.4",
534
540
  "fast-glob": "3.3.3",
535
- "intlayer": "9.5.3",
541
+ "intlayer": "9.5.4",
536
542
  "rimraf": "6.1.3",
537
543
  "shiki": "4.4.3",
538
544
  "storybook": "10.6.0",
539
545
  "tsdown": "0.23.0",
540
546
  "typescript": "7.0.2",
541
547
  "vite": "8.3.0",
542
- "vite-intlayer": "9.5.3",
548
+ "vite-intlayer": "9.5.4",
543
549
  "vite-plugin-dts": "5.1.0",
544
- "vitest": "5.0.0"
550
+ "vitest": "5.0.1"
545
551
  },
546
552
  "peerDependencies": {
547
- "@better-fetch/fetch": "1.3.1",
553
+ "@better-fetch/fetch": "1.3.2",
548
554
  "@hookform/resolvers": "5.9.1",
549
- "@intlayer/backend": "9.5.3",
555
+ "@intlayer/backend": "9.5.4",
550
556
  "@monaco-editor/react": "4.7.0",
551
557
  "@shikijs/core": "4.4.3",
552
558
  "@shikijs/engine-oniguruma": "4.4.3",
553
559
  "@shikijs/transformers": "4.4.3",
554
- "@tanstack/react-query": "5.102.8",
555
- "@tanstack/react-query-devtools": "5.102.8",
556
- "framer-motion": "13.3.0",
560
+ "@tanstack/react-query": "5.103.1",
561
+ "@tanstack/react-query-devtools": "5.103.1",
562
+ "framer-motion": "13.4.0",
557
563
  "fuse.js": "7.5.0",
558
- "intlayer": "9.5.3",
559
- "lucide-react": "1.46.0",
564
+ "intlayer": "9.5.4",
565
+ "lucide-react": "1.47.0",
560
566
  "react": ">=16.0.0",
561
567
  "react-dom": ">=16.0.0",
562
568
  "react-hook-form": "7.88.0",
563
- "react-intlayer": "9.5.3",
569
+ "react-intlayer": "9.5.4",
564
570
  "shiki": "4.4.3",
565
571
  "tailwindcss": "4.3.3"
566
572
  },