@dxos/app-framework 0.7.4 → 0.7.5-main.499c70c

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 (128) hide show
  1. package/dist/lib/browser/chunk-QG25ZU2N.mjs +320 -0
  2. package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-SPDTXTOV.mjs +163 -0
  4. package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-653Y45CL.mjs → chunk-WBOXEHBE.mjs} +12 -2
  6. package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +224 -109
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/{plugin-intent-LU4KL2RO.mjs → plugin-intent-T7Y3MJ5C.mjs} +14 -4
  11. package/dist/lib/browser/{plugin-settings-OM3G2QFY.mjs → plugin-settings-5U2L2NRU.mjs} +6 -2
  12. package/dist/lib/browser/{plugin-surface-LECZMKSQ.mjs → plugin-surface-OKPF3EQI.mjs} +4 -4
  13. package/dist/lib/node/{chunk-SOVLKUWI.cjs → chunk-BW3RNEVI.cjs} +51 -102
  14. package/dist/lib/node/chunk-BW3RNEVI.cjs.map +7 -0
  15. package/dist/lib/node/{chunk-JZ2JVKRY.cjs → chunk-FCMHRU3M.cjs} +17 -5
  16. package/dist/lib/node/chunk-FCMHRU3M.cjs.map +7 -0
  17. package/dist/lib/node/chunk-VWHAALIN.cjs +344 -0
  18. package/dist/lib/node/chunk-VWHAALIN.cjs.map +7 -0
  19. package/dist/lib/node/index.cjs +232 -114
  20. package/dist/lib/node/index.cjs.map +4 -4
  21. package/dist/lib/node/meta.json +1 -1
  22. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +53 -0
  23. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +7 -0
  24. package/dist/lib/node/{plugin-settings-OZ6IKAE5.cjs → plugin-settings-W6UHMH5M.cjs} +12 -8
  25. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +7 -0
  26. package/dist/lib/node/{plugin-surface-YWDRXQTD.cjs → plugin-surface-CCSIONYW.cjs} +15 -15
  27. package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-YNU7FTGJ.mjs → chunk-3T5UIJY3.mjs} +12 -2
  29. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +7 -0
  30. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +164 -0
  31. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +7 -0
  32. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +321 -0
  33. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +7 -0
  34. package/dist/lib/node-esm/index.mjs +224 -109
  35. package/dist/lib/node-esm/index.mjs.map +4 -4
  36. package/dist/lib/node-esm/meta.json +1 -1
  37. package/dist/lib/node-esm/{plugin-intent-V7ER24Y6.mjs → plugin-intent-W2HQC6LC.mjs} +14 -4
  38. package/dist/lib/node-esm/{plugin-settings-37UVWF2V.mjs → plugin-settings-H5RHNFVC.mjs} +6 -2
  39. package/dist/lib/node-esm/{plugin-surface-TEU42XQN.mjs → plugin-surface-V3YET3UL.mjs} +4 -4
  40. package/dist/types/src/plugins/common/layout.d.ts +145 -171
  41. package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
  42. package/dist/types/src/plugins/common/navigation.d.ts +77 -30
  43. package/dist/types/src/plugins/common/navigation.d.ts.map +1 -1
  44. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +2 -7
  45. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +1 -1
  46. package/dist/types/src/plugins/plugin-host/index.d.ts +2 -0
  47. package/dist/types/src/plugins/plugin-host/index.d.ts.map +1 -1
  48. package/dist/types/src/plugins/plugin-host/plugin.d.ts +7 -1
  49. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +1 -1
  50. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts +7 -20
  51. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +1 -1
  52. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +1 -1
  53. package/dist/types/src/plugins/plugin-intent/index.d.ts +1 -0
  54. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +1 -1
  55. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts +107 -0
  56. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +1 -0
  57. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts +2 -0
  58. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
  59. package/dist/types/src/plugins/plugin-intent/intent.d.ts +65 -58
  60. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +1 -1
  61. package/dist/types/src/plugins/plugin-intent/meta.d.ts +1 -0
  62. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +1 -1
  63. package/dist/types/src/plugins/plugin-intent/provides.d.ts +6 -10
  64. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +1 -1
  65. package/dist/types/src/plugins/plugin-settings/provides.d.ts +15 -2
  66. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +1 -1
  67. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +2 -57
  68. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +1 -1
  69. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts +85 -0
  70. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +1 -0
  71. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +1 -1
  72. package/dist/types/src/plugins/plugin-surface/index.d.ts +1 -1
  73. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +1 -1
  74. package/dist/types/src/plugins/plugin-surface/provides.d.ts +5 -4
  75. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +1 -1
  76. package/dist/types/tsconfig.tsbuildinfo +1 -0
  77. package/package.json +14 -12
  78. package/src/plugins/common/layout.ts +125 -107
  79. package/src/plugins/common/navigation.ts +59 -30
  80. package/src/plugins/plugin-host/HostPlugin.tsx +2 -10
  81. package/src/plugins/plugin-host/PluginContainer.tsx +1 -1
  82. package/src/plugins/plugin-host/index.ts +4 -0
  83. package/src/plugins/plugin-host/plugin.ts +8 -1
  84. package/src/plugins/plugin-intent/IntentContext.tsx +13 -36
  85. package/src/plugins/plugin-intent/IntentPlugin.tsx +44 -120
  86. package/src/plugins/plugin-intent/index.ts +1 -0
  87. package/src/plugins/plugin-intent/intent-dispatcher.test.ts +279 -0
  88. package/src/plugins/plugin-intent/intent-dispatcher.ts +285 -0
  89. package/src/plugins/plugin-intent/intent.ts +126 -65
  90. package/src/plugins/plugin-intent/meta.ts +3 -1
  91. package/src/plugins/plugin-intent/provides.ts +8 -20
  92. package/src/plugins/plugin-settings/provides.ts +10 -5
  93. package/src/plugins/plugin-surface/Surface.tsx +25 -158
  94. package/src/plugins/plugin-surface/SurfaceContext.ts +112 -0
  95. package/src/plugins/plugin-surface/SurfacePlugin.tsx +19 -7
  96. package/src/plugins/plugin-surface/index.ts +1 -1
  97. package/src/plugins/plugin-surface/provides.ts +8 -7
  98. package/tsconfig.json +38 -1
  99. package/dist/lib/browser/chunk-653Y45CL.mjs.map +0 -7
  100. package/dist/lib/browser/chunk-FRXJ25VI.mjs +0 -214
  101. package/dist/lib/browser/chunk-FRXJ25VI.mjs.map +0 -7
  102. package/dist/lib/browser/chunk-YXM35XRE.mjs +0 -213
  103. package/dist/lib/browser/chunk-YXM35XRE.mjs.map +0 -7
  104. package/dist/lib/node/chunk-JZ2JVKRY.cjs.map +0 -7
  105. package/dist/lib/node/chunk-QSVP5HOW.cjs +0 -238
  106. package/dist/lib/node/chunk-QSVP5HOW.cjs.map +0 -7
  107. package/dist/lib/node/chunk-SOVLKUWI.cjs.map +0 -7
  108. package/dist/lib/node/plugin-intent-FVFR2LKB.cjs +0 -43
  109. package/dist/lib/node/plugin-intent-FVFR2LKB.cjs.map +0 -7
  110. package/dist/lib/node/plugin-settings-OZ6IKAE5.cjs.map +0 -7
  111. package/dist/lib/node/plugin-surface-YWDRXQTD.cjs.map +0 -7
  112. package/dist/lib/node-esm/chunk-2R4GVK7O.mjs +0 -215
  113. package/dist/lib/node-esm/chunk-2R4GVK7O.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-YFMFQBB4.mjs +0 -214
  115. package/dist/lib/node-esm/chunk-YFMFQBB4.mjs.map +0 -7
  116. package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs.map +0 -7
  117. package/dist/types/src/plugins/plugin-intent/helpers.d.ts +0 -6
  118. package/dist/types/src/plugins/plugin-intent/helpers.d.ts.map +0 -1
  119. package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts +0 -39
  120. package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts.map +0 -1
  121. package/src/plugins/plugin-intent/helpers.ts +0 -11
  122. package/src/plugins/plugin-surface/SurfaceRootContext.tsx +0 -60
  123. /package/dist/lib/browser/{plugin-intent-LU4KL2RO.mjs.map → plugin-intent-T7Y3MJ5C.mjs.map} +0 -0
  124. /package/dist/lib/browser/{plugin-settings-OM3G2QFY.mjs.map → plugin-settings-5U2L2NRU.mjs.map} +0 -0
  125. /package/dist/lib/browser/{plugin-surface-LECZMKSQ.mjs.map → plugin-surface-OKPF3EQI.mjs.map} +0 -0
  126. /package/dist/lib/node-esm/{plugin-intent-V7ER24Y6.mjs.map → plugin-intent-W2HQC6LC.mjs.map} +0 -0
  127. /package/dist/lib/node-esm/{plugin-settings-37UVWF2V.mjs.map → plugin-settings-H5RHNFVC.mjs.map} +0 -0
  128. /package/dist/lib/node-esm/{plugin-surface-TEU42XQN.mjs.map → plugin-surface-V3YET3UL.mjs.map} +0 -0
@@ -1,21 +1,8 @@
1
- import { type Provider } from 'react';
2
- import type { UnsubscribeCallback } from '@dxos/async';
3
- import type { Intent, IntentDispatcher, IntentResolver, IntentResult } from './intent';
4
- export type IntentExecution = {
5
- intent: Intent;
6
- result: IntentResult;
7
- };
8
- export type IntentContext = {
9
- dispatch: IntentDispatcher;
10
- undo: () => Promise<IntentResult | void>;
11
- history: IntentExecution[][];
12
- registerResolver: (pluginId: string, resolver: IntentResolver) => UnsubscribeCallback;
13
- };
14
- /**
15
- * @deprecated Prefer granular hooks.
16
- */
17
- export declare const useIntent: () => IntentContext;
18
- export declare const useIntentDispatcher: () => IntentDispatcher;
19
- export declare const useIntentResolver: (plugin: string, resolver: IntentResolver) => void;
20
- export declare const IntentProvider: Provider<IntentContext>;
1
+ import { type Context, type Provider } from 'react';
2
+ import { type AnyIntentResolver, type IntentContext } from './intent-dispatcher';
3
+ declare const IntentContext: Context<IntentContext | undefined>;
4
+ export declare const useIntentDispatcher: () => Pick<IntentContext, "dispatch" | "dispatchPromise">;
5
+ export declare const useIntentResolver: (pluginId: string, resolver: AnyIntentResolver) => void;
6
+ export declare const IntentProvider: Provider<IntentContext | undefined>;
7
+ export {};
21
8
  //# sourceMappingURL=IntentContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA2C,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEvF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACzC,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC;IAC7B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,mBAAmB,CAAC;CACvF,CAAC;AASF;;GAEG;AAEH,eAAO,MAAM,SAAS,qBAAkC,CAAC;AAEzD,eAAO,MAAM,mBAAmB,QAAO,gBAGtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,YAAY,cAAc,SAKzE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,CAA0B,CAAC"}
1
+ {"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAA6B,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAC;AAK1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEjF,QAAA,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,CAAuD,CAAC;AAE9G,eAAO,MAAM,mBAAmB,QAAO,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,iBAAiB,CAGxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,MAAM,YAAY,iBAAiB,SAK9E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,CAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntentPlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/IntentPlugin.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKvD;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAO,gBAAgB,CAAC,oBAAoB,CAyHpE,CAAC"}
1
+ {"version":3,"file":"IntentPlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/IntentPlugin.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,oBAAoB,EAAuD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKvD;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAO,gBAAgB,CAAC,oBAAoB,CAwCpE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { IntentPlugin } from './IntentPlugin';
2
2
  export * from './intent';
3
+ export * from './intent-dispatcher';
3
4
  export * from './provides';
4
5
  export * from './IntentContext';
5
6
  export default IntentPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAEhC,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAEhC,eAAe,YAAY,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { Effect } from 'effect';
2
+ import { type MaybePromise } from '@dxos/util';
3
+ import { type AnyIntentChain, type IntentChain, type IntentData, type IntentParams, type IntentResultData, type IntentSchema, type Label } from './intent';
4
+ /**
5
+ * The return value of an intent effect.
6
+ */
7
+ export type IntentEffectResult<Fields extends IntentParams> = {
8
+ /**
9
+ * The output of the action that was performed.
10
+ *
11
+ * If the intent is apart of a chain of intents, the data will be passed to the next intent.
12
+ */
13
+ data?: IntentResultData<Fields>;
14
+ /**
15
+ * If provided, the action will be undoable.
16
+ */
17
+ undoable?: {
18
+ /**
19
+ * Message to display to the user when indicating that the action can be undone.
20
+ */
21
+ message: Label;
22
+ /**
23
+ * Will be merged with the original intent data when firing the undo intent.
24
+ */
25
+ data?: Partial<IntentData<Fields>>;
26
+ };
27
+ /**
28
+ * An error that occurred while performing the action.
29
+ *
30
+ * If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
31
+ */
32
+ error?: Error;
33
+ /**
34
+ * Other intent chains to be triggered.
35
+ */
36
+ intents?: AnyIntentChain[];
37
+ };
38
+ export type AnyIntentEffectResult = IntentEffectResult<any>;
39
+ /**
40
+ * The result of an intent dispatcher.
41
+ */
42
+ export type IntentDispatcherResult<Fields extends IntentParams> = Pick<IntentEffectResult<Fields>, 'data' | 'error'>;
43
+ /**
44
+ * Determines the priority of the effect when multiple intent resolvers are matched.
45
+ *
46
+ * - `static` - The effect is selected in the order it was resolved.
47
+ * - `hoist` - The effect is selected before `static` effects.
48
+ * - `fallback` - The effect is selected after `static` effects.
49
+ */
50
+ export type IntentDisposition = 'static' | 'hoist' | 'fallback';
51
+ /**
52
+ * The implementation of an intent effect.
53
+ */
54
+ export type IntentEffectDefinition<Fields extends IntentParams> = (data: IntentData<Fields>, undo: boolean) => MaybePromise<IntentEffectResult<Fields> | void> | Effect.Effect<IntentEffectResult<Fields> | void>;
55
+ /**
56
+ * Intent resolver to match intents to their effects.
57
+ */
58
+ export type IntentResolver<Tag extends string, Fields extends IntentParams> = {
59
+ action: Tag;
60
+ disposition?: IntentDisposition;
61
+ filter?: (data: IntentData<Fields>) => boolean;
62
+ effect: IntentEffectDefinition<Fields>;
63
+ };
64
+ export type AnyIntentResolver = IntentResolver<any, any>;
65
+ /**
66
+ * Creates an intent resolver to match intents to their effects.
67
+ * @param schema Schema of the intent. Must be a tagged class with input and output schemas.
68
+ * @param effect Effect to be performed when the intent is resolved.
69
+ * @param params.disposition Determines the priority of the resolver when multiple are resolved.
70
+ * @param params.filter Optional filter to determine if the resolver should be used.
71
+ */
72
+ export declare const createResolver: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, effect: IntentEffectDefinition<Fields>, params?: Pick<IntentResolver<Tag, Fields>, "disposition" | "filter">) => IntentResolver<Tag, Fields>;
73
+ /**
74
+ * Invokes intents and returns the result.
75
+ */
76
+ export type PromiseIntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>) => Promise<IntentDispatcherResult<Fields>>;
77
+ /**
78
+ * Creates an effect for intents.
79
+ */
80
+ export type IntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>, depth?: number) => Effect.Effect<IntentDispatcherResult<Fields>, Error>;
81
+ /**
82
+ * Invokes the most recent undoable intent with undo flags.
83
+ */
84
+ export type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any> | undefined>;
85
+ /**
86
+ * Creates an effect which undoes the last intent.
87
+ */
88
+ export type IntentUndo = () => Effect.Effect<IntentDispatcherResult<any> | undefined, Error>;
89
+ export type IntentContext = {
90
+ dispatch: IntentDispatcher;
91
+ dispatchPromise: PromiseIntentDispatcher;
92
+ undo: IntentUndo;
93
+ undoPromise: PromiseIntentUndo;
94
+ registerResolver: (id: string, resolver: AnyIntentResolver) => () => void;
95
+ };
96
+ /**
97
+ * Sets of an intent dispatcher.
98
+ *
99
+ * @param resolvers An array of available intent resolvers.
100
+ * @param params.historyLimit The maximum number of intent results to keep in history.
101
+ * @param params.executionLimit The maximum recursion depth of intent chains.
102
+ */
103
+ export declare const createDispatcher: (resolvers: Record<string, AnyIntentResolver[]>, { executionLimit, historyLimit }?: {
104
+ executionLimit?: number | undefined;
105
+ historyLimit?: number | undefined;
106
+ }) => IntentContext;
107
+ //# sourceMappingURL=intent-dispatcher.d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AAM,KACX,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AAQ1D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC;AAQ7F,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,eAAe,EAAE,uBAAuB,CAAC;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,KAAK,MAAM,IAAI,CAAC;CAC3E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,cAChB,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC;;;MAE7C,aA+GF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=intent-dispatcher.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-dispatcher.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent-dispatcher.test.ts"],"names":[],"mappings":""}
@@ -1,81 +1,88 @@
1
- import type { MaybePromise } from '@dxos/util';
2
- import type { Plugin } from '../plugin-host';
3
- /**
4
- * Type of data returned from an intent.
5
- */
6
- export type IntentData<T extends Record<string, any> = Record<string, any>> = T & {
7
- /**
8
- * The data from the result of the previous intent.
9
- */
10
- result?: any;
1
+ import { S } from '@dxos/echo-schema';
2
+ export type IntentParams = {
3
+ readonly input: S.Schema.All;
4
+ readonly output: S.Schema.All;
11
5
  };
6
+ export type IntentData<Fields extends IntentParams> = S.Schema.Type<S.Struct<Fields>> extends {
7
+ readonly input: any;
8
+ } ? S.Schema.Type<S.Struct<Fields>>['input'] : any;
9
+ export type IntentResultData<Fields extends IntentParams> = S.Schema.Type<S.Struct<Fields>> extends {
10
+ readonly output: any;
11
+ } ? S.Schema.Type<S.Struct<Fields>>['output'] : any;
12
+ export type IntentSchema<Tag extends string, Fields extends IntentParams> = S.TaggedClass<any, Tag, Fields>;
12
13
  /**
13
14
  * An intent is an abstract description of an operation to be performed.
14
15
  * Intents allow actions to be performed across plugins.
15
16
  */
16
- export type Intent = {
17
+ export type Intent<Tag extends string, Fields extends IntentParams> = {
18
+ _schema: IntentSchema<Tag, Fields>;
19
+ /**
20
+ * The action to perform.
21
+ */
22
+ action: Tag;
23
+ /**
24
+ * Any data needed to perform the desired action.
25
+ */
26
+ data: IntentData<Fields>;
17
27
  /**
18
28
  * Plugin ID.
19
29
  * If specified, the intent will be sent explicitly to the plugin.
20
30
  * Otherwise, the intent will be sent to all plugins, in order and the first to resolve a non-null value will be used.
21
31
  */
22
32
  plugin?: string;
23
- /**
24
- * The action to perform.
25
- */
26
- action: string;
27
33
  /**
28
34
  * Whether or not the intent is being undone.
29
35
  */
30
36
  undo?: boolean;
31
- /**
32
- * Any data needed to perform the desired action.
33
- */
34
- data?: IntentData;
35
37
  };
36
- export type IntentResult = {
37
- /**
38
- * The output of the action that was performed.
39
- *
40
- * If the intent is apart of a chain of intents, the data will be passed to the next intent.
41
- */
42
- data?: any;
43
- /**
44
- * If provided, the action will be undoable.
45
- */
46
- undoable?: {
47
- /**
48
- * Message to display to the user when indicating that the action can be undone.
49
- */
50
- message: string;
51
- /**
52
- * Will be merged with the original intent data when firing the undo intent.
53
- */
54
- data?: IntentData;
55
- };
56
- /**
57
- * An error that occurred while performing the action.
58
- *
59
- * If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
60
- */
61
- error?: Error;
62
- /**
63
- * Other intent chains to be triggered.
64
- */
65
- intents?: Intent[][];
38
+ export type AnyIntent = Intent<any, any>;
39
+ /**
40
+ * Chain of intents to be executed together.
41
+ * The result of each intent is merged into the next intent's input data.
42
+ */
43
+ export type IntentChain<FirstTag extends string, LastTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams> = {
44
+ first: Intent<FirstTag, FirstFields>;
45
+ last: Intent<LastTag, LastFields>;
46
+ all: AnyIntent[];
66
47
  };
48
+ export type AnyIntentChain = IntentChain<any, any, any, any>;
67
49
  /**
68
- * Trigger one or more intents to be sent.
69
- * If multiple intents are specified, the result of each will be merged with the data to the next.
70
- *
71
- * @returns The result of the last intent.
50
+ * Creates a typed intent.
51
+ * @param schema Schema of the intent. Must be a tagged class with input and output schemas.
52
+ * @param data Data fulfilling the input schema of the intent.
53
+ * @param params.plugin Optional plugin ID to send the intent to.
54
+ * @param params.undo Optional flag to indicate that the intent is being undone. Generally not set manually.
72
55
  */
73
- export type IntentDispatcher = (intent: Intent | Intent[]) => Promise<IntentResult | void>;
56
+ export declare const createIntent: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, data?: IntentData<Fields>, params?: Pick<AnyIntent, "plugin" | "undo">) => IntentChain<Tag, Tag, Fields, Fields>;
74
57
  /**
75
- * Resolves an intent that was dispatched.
76
- * If the intent is not handled, nothing should be returned.
58
+ * Chain two intents together.
77
59
  *
78
- * @returns The result of the intent.
60
+ * NOTE: Chaining of intents depends on the data inputs and outputs being structs.
79
61
  */
80
- export type IntentResolver = (intent: Intent, plugins: Plugin[]) => MaybePromise<IntentResult | void>;
62
+ export declare const chain: <FirstTag extends string, NextTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams, NextFields extends IntentParams>(schema: IntentSchema<NextTag, NextFields>, data?: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>>, params?: Pick<AnyIntent, "plugin" | "undo">) => (intent: IntentChain<FirstTag, any, FirstFields, LastFields>) => IntentChain<FirstTag, NextTag, FirstFields, NextFields>;
63
+ export declare const Label: S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
64
+ ns: typeof S.String;
65
+ count: S.optional<typeof S.Number>;
66
+ }>>]>>]>;
67
+ export type Label = S.Schema.Type<typeof Label>;
68
+ export declare const INTENT_ACTION = "dxos.org/plugin/intent/action";
69
+ export declare namespace IntentAction {
70
+ const ShowUndo_base: S.TaggedClass<ShowUndo, "dxos.org/plugin/intent/action/show-undo", {
71
+ readonly _tag: S.tag<"dxos.org/plugin/intent/action/show-undo">;
72
+ } & {
73
+ input: S.Struct<{
74
+ message: S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
75
+ ns: typeof S.String;
76
+ count: S.optional<typeof S.Number>;
77
+ }>>]>>]>;
78
+ }>;
79
+ output: typeof S.Void;
80
+ }>;
81
+ /**
82
+ * Fired after an intent is dispatched if the intent is undoable.
83
+ */
84
+ export class ShowUndo extends ShowUndo_base {
85
+ }
86
+ export {};
87
+ }
81
88
  //# sourceMappingURL=intent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG;IAChF;;OAEG;IAEH,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IA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+1,4 @@
1
+ export declare const INTENT_PLUGIN = "dxos.org/plugin/intent";
1
2
  declare const IntentMeta: {
2
3
  id: string;
3
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/meta.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU;;CAEf,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/meta.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,QAAA,MAAM,UAAU;;CAEf,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,9 +1,10 @@
1
- import { type IntentContext } from './IntentContext';
2
- import { type IntentResolver } from './intent';
3
- import { type Plugin } from '../plugin-host';
1
+ import { type IntentContext, type AnyIntentResolver } from './intent-dispatcher';
2
+ import { type HostContext, type Plugin } from '../plugin-host';
3
+ type Context = HostContext & IntentContext;
4
+ export type ResolverDefinitions = AnyIntentResolver | AnyIntentResolver[] | ResolverDefinitions[];
4
5
  export type IntentResolverProvides = {
5
6
  intent: {
6
- resolver: IntentResolver;
7
+ resolvers: (context: Context) => ResolverDefinitions;
7
8
  };
8
9
  };
9
10
  export type IntentPluginProvides = {
@@ -11,10 +12,5 @@ export type IntentPluginProvides = {
11
12
  };
12
13
  export declare const parseIntentPlugin: (plugin: Plugin) => Plugin<IntentPluginProvides> | undefined;
13
14
  export declare const parseIntentResolverPlugin: (plugin: Plugin) => Plugin<IntentResolverProvides> | undefined;
14
- export declare enum IntentAction {
15
- /**
16
- * Fired after an intent is dispatched if the intent is undoable.
17
- */
18
- SHOW_UNDO = "dxos.org/plugin/intent/action/show-undo"
19
- }
15
+ export {};
20
16
  //# sourceMappingURL=provides.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,QAAQ,EAAE,cAAc,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,6CACkD,CAAC;AAEnG,eAAO,MAAM,yBAAyB,WAAY,MAAM,+CAC4C,CAAC;AAUrG,oBAAY,YAAY;IACtB;;OAEG;IACH,SAAS,4CAA+B;CACzC"}
1
+ {"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-intent/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,KAAK,OAAO,GAAG,WAAW,GAAG,aAAa,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,EAAE,CAAC;AAElG,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,mBAAmB,CAAC;KACtD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,6CACkD,CAAC;AAEnG,eAAO,MAAM,yBAAyB,WAAY,MAAM,+CAC6C,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { S } from '@dxos/echo-schema';
1
2
  import { type SettingsStoreFactory, type SettingsValue } from '@dxos/local-storage';
2
3
  import { type Plugin } from '../plugin-host';
3
4
  export type SettingsProvides<T extends SettingsValue> = {
@@ -7,7 +8,19 @@ export type SettingsPluginProvides = {
7
8
  settingsStore: SettingsStoreFactory;
8
9
  };
9
10
  export declare const parseSettingsPlugin: (plugin: Plugin) => Plugin<SettingsPluginProvides> | undefined;
10
- export declare enum SettingsAction {
11
- OPEN = "dxos.org/plugin/settings/action/open"
11
+ export declare const SETTINGS_PLUGIN = "dxos.org/plugin/settings";
12
+ export declare const SETTINGS_ACTION = "dxos.org/plugin/settings/action";
13
+ export declare namespace SettingsAction {
14
+ const Open_base: S.TaggedClass<Open, "dxos.org/plugin/settings/action/open", {
15
+ readonly _tag: S.tag<"dxos.org/plugin/settings/action/open">;
16
+ } & {
17
+ input: S.Struct<{
18
+ plugin: S.optional<typeof S.String>;
19
+ }>;
20
+ output: typeof S.Void;
21
+ }>;
22
+ export class Open extends Open_base {
23
+ }
24
+ export {};
12
25
  }
13
26
  //# sourceMappingURL=provides.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAAI;IACtD,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY,MAAM,+CAIjD,CAAC;AAMF,oBAAY,cAAc;IACxB,IAAI,yCAA4B;CACjC"}
1
+ {"version":3,"file":"provides.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-settings/provides.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAAI;IACtD,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY,MAAM,+CAIjD,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAE3D,yBAAiB,cAAc,CAAC;;;;;;;;;IAC9B,MAAM,OAAO,IAAK,SAAQ,SAKxB;KAAG;;CACN"}
@@ -1,62 +1,7 @@
1
- import React, { type PropsWithChildren, type ReactNode } from 'react';
2
- import { ErrorBoundary } from './ErrorBoundary';
3
- /**
4
- * Direction determines how multiple components are laid out.
5
- */
6
- export type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';
7
- /**
8
- * SurfaceProps are the props that are passed to the Surface component.
9
- */
10
- export type SurfaceProps = PropsWithChildren<{
11
- /**
12
- * Optional ID for debugging.
13
- */
14
- id?: string;
15
- /**
16
- * Role defines how the data should be rendered.
17
- */
18
- role?: string;
19
- /**
20
- * Names allow nested surfaces to be specified in the parent context, similar to a slot.
21
- * Defaults to the value of `role` if not specified.
22
- */
23
- name?: string;
24
- /**
25
- * The data to be rendered by the surface.
26
- */
27
- data?: Record<string, unknown>;
28
- /**
29
- * Configure nested surfaces (indexed by the surface's `name`).
30
- */
31
- surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;
32
- /**
33
- * If specified, the Surface will be wrapped in an error boundary.
34
- * The fallback component will be rendered if an error occurs.
35
- */
36
- fallback?: ErrorBoundary['props']['fallback'];
37
- /**
38
- * If specified, the Surface will be wrapped in a suspense boundary.
39
- * The placeholder component will be rendered while the surface component is loading.
40
- */
41
- placeholder?: ReactNode;
42
- /**
43
- * If more than one component is resolved, the limit determines how many are rendered.
44
- */
45
- limit?: number | undefined;
46
- /**
47
- * If more than one component is resolved, the direction determines how they are laid out.
48
- * NOTE: This is not yet implemented.
49
- */
50
- direction?: Direction;
51
- /**
52
- * Additional props to pass to the component.
53
- * These props are not used by Surface itself but may be used by components which resolve the surface.
54
- */
55
- [key: string]: unknown;
56
- }>;
1
+ import React from 'react';
2
+ import { type SurfaceProps } from './SurfaceContext';
57
3
  /**
58
4
  * A surface is a named region of the screen that can be populated by plugins.
59
5
  */
60
6
  export declare const Surface: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SurfaceProps, "ref"> & React.RefAttributes<HTMLElement>>>;
61
- export declare const useSurface: () => SurfaceProps;
62
7
  //# sourceMappingURL=Surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAGZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EASf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,gBAAgB,GAAG,OAAO,GAAG,eAAe,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;IAC3C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAE9C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,OAAO,0HAkCnB,CAAC;AAIF,eAAO,MAAM,UAAU,QAAO,YAC+C,CAAC"}
1
+ {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAKrF,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kBAAkB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,OAAO,0HA+CnB,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';
2
+ import { type GuardedType, type MakeOptional } from '@dxos/util';
3
+ import { type ErrorBoundary } from './ErrorBoundary';
4
+ /**
5
+ * SurfaceProps are the props that are passed to the Surface component.
6
+ */
7
+ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
8
+ /**
9
+ * If specified, the Surface will be wrapped in an error boundary.
10
+ * The fallback component will be rendered if an error occurs.
11
+ */
12
+ fallback?: ErrorBoundary['props']['fallback'];
13
+ /**
14
+ * If specified, the Surface will be wrapped in a suspense boundary.
15
+ * The placeholder component will be rendered while the surface component is loading.
16
+ */
17
+ placeholder?: ReactNode;
18
+ }> & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {
19
+ /**
20
+ * Additional props to pass to the component.
21
+ * These props are not used by Surface itself but may be used by components which resolve the surface.
22
+ */
23
+ [key: string]: unknown;
24
+ };
25
+ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
26
+ /**
27
+ * ID for debugging.
28
+ */
29
+ id: string;
30
+ /**
31
+ * Role defines how the data should be rendered.
32
+ */
33
+ role: string;
34
+ /**
35
+ * The data to be rendered by the surface.
36
+ */
37
+ data: T;
38
+ /**
39
+ * If more than one component is resolved, the limit determines how many are rendered.
40
+ */
41
+ limit?: number | undefined;
42
+ };
43
+ type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<CoreSurfaceProps<T> & {
44
+ [key: string]: unknown;
45
+ }>;
46
+ /**
47
+ * React component used to render a surface once is has matched.
48
+ */
49
+ export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = (props: SurfaceComponentProps<T>, forwardedRef: ForwardedRef<HTMLElement>) => JSX.Element | null;
50
+ /**
51
+ * Determines the priority of the surface when multiple components are resolved.
52
+ *
53
+ * - `static` - The component is rendered in the order it was resolved.
54
+ * - `hoist` - The component is rendered before `static` components.
55
+ * - `fallback` - The component is rendered after `static` components.
56
+ */
57
+ export type SurfaceDisposition = 'static' | 'hoist' | 'fallback';
58
+ /**
59
+ * Definition of when a SurfaceComponent should be rendered.
60
+ */
61
+ export type SurfaceDefinition<T extends Record<string, any> = any> = {
62
+ id: string;
63
+ role: string | string[];
64
+ disposition?: SurfaceDisposition;
65
+ filter?: (data: Record<string, unknown>) => data is T;
66
+ component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
67
+ };
68
+ export declare const createSurface: <T extends Record<string, any> = any>(definition: SurfaceDefinition<T>) => SurfaceDefinition<T>;
69
+ /**
70
+ * Surface debug info.
71
+ * NOTE: Short-term measure to track perf issues.
72
+ */
73
+ export type DebugInfo = {
74
+ id: string;
75
+ created: number;
76
+ renderCount: number;
77
+ } & Pick<SurfaceProps, 'role'>;
78
+ export type SurfaceContextValue = {
79
+ surfaces: Record<string, SurfaceDefinition>;
80
+ debugInfo?: Map<string, DebugInfo>;
81
+ };
82
+ export declare const useSurfaceRoot: () => SurfaceContextValue;
83
+ export declare const SurfaceProvider: import("react").Provider<SurfaceContextValue | undefined>;
84
+ export {};
85
+ //# sourceMappingURL=SurfaceContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SurfaceContext.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfaceContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,iBAAiB,CAAC;IACpG;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAE9C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC,GACA,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IACjD;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAGJ,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAA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AC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC1E,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,iBAAiB,CAAC,CAAC,CAAC,yBAAe,CAAC;AAEnH;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,cAAc,2BAAiF,CAAC;AAE7G,eAAO,MAAM,eAAe,2DAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SurfacePlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfacePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,gBAAgB,CAAC,qBAAqB,CAetE,CAAC"}
1
+ {"version":3,"file":"SurfacePlugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/SurfacePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,qBAAqB,EAA2B,MAAM,YAAY,CAAC;AAErG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,gBAAgB,CAAC,qBAAqB,CAgBtE,CAAC"}
@@ -3,6 +3,6 @@ export * from './helpers';
3
3
  export * from './provides';
4
4
  export * from './ErrorBoundary';
5
5
  export * from './Surface';
6
- export * from './SurfaceRootContext';
6
+ export * from './SurfaceContext';
7
7
  export default SurfacePlugin;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AAErC,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/plugin-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AAEjC,eAAe,aAAa,CAAC"}
@@ -1,15 +1,16 @@
1
- import { type SurfaceComponent, type SurfaceRootContext } from './SurfaceRootContext';
2
- import { type Plugin } from '../plugin-host';
1
+ import { type SurfaceDefinition, type SurfaceContextValue } from './SurfaceContext';
2
+ import { type HostContext, type Plugin } from '../plugin-host';
3
+ export type SurfaceDefinitions = SurfaceDefinition | SurfaceDefinition[] | SurfaceDefinitions[];
3
4
  export type SurfaceProvides = {
4
5
  surface: {
5
6
  /**
6
7
  * Used by the `Surface` resolver to find a component to render.
7
8
  */
8
- component: SurfaceComponent;
9
+ definitions: (context: HostContext) => SurfaceDefinitions;
9
10
  };
10
11
  };
11
12
  export type SurfacePluginProvides = {
12
- surface: SurfaceRootContext;
13
+ surface: SurfaceContextValue;
13
14
  };
14
15
  export declare const parseRootSurfacePlugin: (plugin?: Plugin) => Plugin<SurfacePluginProvides> | undefined;
15
16
  export declare const parseSurfacePlugin: (plugin?: Plugin) => Plugin<SurfaceProvides> | undefined;