bitboss-ui 3.0.0-beta.62 → 3.0.0-beta.63

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 (46) hide show
  1. package/dist/ai/BbConfirm.md +46 -22
  2. package/dist/ai/BbForm.md +66 -4
  3. package/dist/ai/BbHost.md +11 -13
  4. package/dist/ai/BbPtScope.md +6 -4
  5. package/dist/ai/BbTable.md +65 -5
  6. package/dist/ai/changelog.json +28 -4
  7. package/dist/ai/components.json +5 -5
  8. package/dist/ai/composables/useConfirm.md +8 -5
  9. package/dist/ai/guides/agent-contract.md +3 -2
  10. package/dist/ai/guides/migration/components/bb-host.md +4 -2
  11. package/dist/ai/guides/migration/components/use-confirm.md +15 -15
  12. package/dist/ai/guides/migration/v2-to-v3.md +9 -0
  13. package/dist/ai/guides/passthrough.md +57 -57
  14. package/dist/ai/guides/validated-forms.md +5 -0
  15. package/dist/ai/helpers/inertia/manifest.json +1 -1
  16. package/dist/ai/manifest/components/BbHost.tree.json +1 -2
  17. package/dist/ai/manifest/components/BbTable.json +2 -0
  18. package/dist/ai/manifest/index.json +2 -2
  19. package/dist/ai/manifest/types.advanced.json +1 -1
  20. package/dist/ai/source/BbConfirm.md +33 -21
  21. package/dist/ai/source/BbConfirmPortal.md +7 -16
  22. package/dist/ai/source/BbHost.md +3 -3
  23. package/dist/ai/source/BbTable.md +37 -9
  24. package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +83 -74
  25. package/dist/components/BbConfirm/BbConfirmHost.d.ts +10 -0
  26. package/dist/components/BbConfirm/BbConfirmHost.js +32 -0
  27. package/dist/components/BbConfirm/BbConfirmPortal.vue_vue_type_script_setup_true_lang.js +8 -12
  28. package/dist/components/BbConfirm/confirmEntry.d.ts +4 -0
  29. package/dist/components/BbConfirm/confirmEntry.js +4 -0
  30. package/dist/components/BbConfirm/types.d.ts +2 -2
  31. package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +2 -2
  32. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +426 -380
  33. package/dist/components/BbTable/BbTableDataRow.js +17 -12
  34. package/dist/components/BbTable/BbTableSelectToggle.d.ts +1 -1
  35. package/dist/components/BbTable/types.d.ts +14 -3
  36. package/dist/components/BbTable/types.js +2 -0
  37. package/dist/composables/useBbFormContext.d.ts +7 -3
  38. package/dist/composables/useConfirm.d.ts +327 -33
  39. package/dist/composables/useConfirm.js +93 -71
  40. package/dist/llms-full.txt +295 -129
  41. package/dist/llms-medium.txt +3 -2
  42. package/dist/styles.css +1 -1
  43. package/dist/types/passthrough.d.ts +1 -1
  44. package/dist/types/ptComponentMap.d.ts +1 -1
  45. package/dist/utils/versionCheck.js +1 -1
  46. package/package.json +1 -1
@@ -19,8 +19,10 @@
19
19
  :pt="passthrough.forward(DIALOG_PARTS, BB_DIALOG_PT.states)"
20
20
  v-bind="dialogAttrs"
21
21
  :size="current?.size ?? config.confirm?.defaultSize"
22
+ :stack="current?.stack ?? CONFIRM_STACK"
22
23
  :title="current?.title"
23
24
  :transition-duration="TRANSITION_DURATION"
25
+ @hidden="removeConfirmEntry(entry)"
24
26
  @update:model-value="onClose"
25
27
  >
26
28
  <div v-if="hasContent" class="bb-confirm__content">
@@ -92,13 +94,13 @@
92
94
  </template>
93
95
 
94
96
  <script setup lang="ts">
95
- import { computed, onMounted, onUnmounted, useAttrs } from 'vue';
97
+ import { computed, inject, markRaw, onMounted, useAttrs } from 'vue';
96
98
  import {
97
- confirmState as state,
99
+ CONFIRM_STACK,
98
100
  namedPortalRegistry,
99
101
  processMessage,
102
+ removeConfirmEntry,
100
103
  TRANSITION_DURATION,
101
- __registerConfirmHost,
102
104
  } from '@/composables/useConfirm';
103
105
  import { useId } from '@/composables/useId';
104
106
  import { useConfig } from '@/composables/useConfig';
@@ -106,6 +108,7 @@ import BbDialog from '../BbDialog/BbDialog.vue';
106
108
  import { usePassthrough } from '@/composables/usePassthrough';
107
109
  import { BB_DIALOG_PT } from '../BbDialog/types';
108
110
  import { BB_CONFIRM_PT, type BbConfirmProps } from './types';
111
+ import { CONFIRM_ENTRY } from './confirmEntry';
109
112
  import BbButton from '../BbButton/BbButton.vue';
110
113
 
111
114
  // Describes the dialog by its plain-text message (WAI-APG dialog pattern): a
@@ -117,6 +120,15 @@ import BbButton from '../BbButton/BbButton.vue';
117
120
  defineOptions({ inheritAttrs: false });
118
121
  const props = defineProps<BbConfirmProps>();
119
122
 
123
+ /**
124
+ * One `confirm()` call (Q75.9): `<BbHost />` renders one of these per call,
125
+ * under the caller's provides, and drops it once its close transition ends.
126
+ */
127
+ const entry = inject(CONFIRM_ENTRY)!;
128
+ const state = entry.state;
129
+ // The message never changes after `confirm()` built it.
130
+ const current = computed(() => entry.message);
131
+
120
132
  /**
121
133
  * Passthrough (plans/passthrough/BbConfirm.md): every part but `text` and
122
134
  * `action` is the dialog's, forwarded as its own `pt`, so the dialog resolves
@@ -134,7 +146,7 @@ const passthrough = usePassthrough({
134
146
  props,
135
147
  parts: BB_CONFIRM_PT.parts,
136
148
  states: BB_CONFIRM_PT.states,
137
- active: { open: () => !!state.value.processing },
149
+ active: { open: () => state.processing },
138
150
  });
139
151
 
140
152
  /**
@@ -158,31 +170,31 @@ const dialogAttrs = computed(() => {
158
170
  const textId = `confirm_text_${useId().id.value}`;
159
171
  const config = useConfig();
160
172
 
161
- // Host-count bookkeeping lives in useConfirm (the zero-host grace in
162
- // `confirm()` reads it). `<BbHost />` mounts this once per app.
163
- let unregisterHost: (() => void) | undefined;
173
+ // Closed before it could render (dismissed while no host was mounted, the
174
+ // host back now): it never opens, so `hidden` never comes. Leave at once.
164
175
  onMounted(() => {
165
- unregisterHost = __registerConfirmHost().unregister;
166
- });
167
- onUnmounted(() => {
168
- unregisterHost?.();
176
+ if (!state.processing) removeConfirmEntry(entry);
169
177
  });
170
178
 
171
- const current = computed(() => state.value.current);
172
-
173
179
  const isBusy = computed(
174
- () =>
175
- state.value.yesBusy || state.value.noBusy || state.value.actionBusy !== null
180
+ () => state.yesBusy || state.noBusy || state.actionBusy !== null
176
181
  );
177
182
 
178
183
  const hasText = computed(() => Boolean(current.value?.text));
179
184
 
185
+ /** What a named portal's slot gets: this confirm's own data and answers. */
186
+ const portalScope = {
187
+ data: current.value.data ?? {},
188
+ yes: () => processMessage(true, false, entry),
189
+ no: () => processMessage(false, true, entry),
190
+ };
191
+
180
192
  const portalContent = computed(() => {
181
193
  const portal = current.value?.portal;
182
194
  if (!portal) return null;
183
- if (typeof portal === 'string')
184
- return namedPortalRegistry.get(portal) ?? null;
185
- return portal;
195
+ if (typeof portal !== 'string') return portal;
196
+ const render = namedPortalRegistry.get(portal);
197
+ return render ? markRaw(() => render(portalScope)) : null;
186
198
  });
187
199
 
188
200
  const hasContent = computed(() => hasText.value || !!portalContent.value);
@@ -218,7 +230,7 @@ const dialogClasses = computed(() => [
218
230
  ]);
219
231
 
220
232
  const onClose = (value: boolean) => {
221
- if (!value) processMessage(false);
233
+ if (!value) processMessage(false, false, entry);
222
234
  };
223
235
  </script>
224
236
 
@@ -233,8 +245,8 @@ const onClose = (value: boolean) => {
233
245
  import type { PtMap, PtValue } from '@/types/passthrough';
234
246
 
235
247
  /**
236
- * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). The host
237
- * renders one `BbDialog` for every confirm: `root`, `sheet`, `header`, `title`,
248
+ * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). Every
249
+ * confirm is its own `BbDialog`: `root`, `sheet`, `header`, `title`,
238
250
  * `content`, `footer` and `close` are forwarded to it, so a `pt:*` on
239
251
  * `<BbConfirm>` styles every confirm the app opens; `text` and `action` are
240
252
  * bound here.
@@ -9,11 +9,7 @@
9
9
  <script setup lang="ts">
10
10
  import { useSlots, watchEffect } from 'vue';
11
11
  import type { BbConfirmPortalSlotProps } from './types';
12
- import {
13
- confirmState,
14
- registerNamedPortal,
15
- processMessage,
16
- } from '@/composables/useConfirm';
12
+ import { registerNamedPortal } from '@/composables/useConfirm';
17
13
 
18
14
  const props = defineProps<{
19
15
  /** The name a confirm passes as `portal: '<name>'` to render this content. */
@@ -25,19 +21,14 @@ defineSlots<{
25
21
 
26
22
  const slots = useSlots();
27
23
 
28
- const yes = () => processMessage(true);
29
- const no = () => processMessage(false, true);
30
-
31
24
  watchEffect((onCleanup) => {
32
25
  // Never populated during SSR — the registry is module state and would leak
33
26
  // across requests (same guard as useBbTabsContext's tabsRegistry).
34
27
  if (typeof window === 'undefined') return;
35
- const cleanup = registerNamedPortal(props.name, () =>
36
- slots.default?.({
37
- yes,
38
- no,
39
- data: confirmState.value.current?.data ?? {},
40
- })
28
+ // The bare slot: each confirm calls it with its own `{ yes, no, data }`
29
+ // (Q75.9), so two open confirms never answer each other.
30
+ const cleanup = registerNamedPortal(props.name, (scope) =>
31
+ slots.default?.(scope)
41
32
  );
42
33
  onCleanup(cleanup);
43
34
  });
@@ -50,8 +41,8 @@ watchEffect((onCleanup) => {
50
41
  import type { PtMap, PtValue } from '@/types/passthrough';
51
42
 
52
43
  /**
53
- * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). The host
54
- * renders one `BbDialog` for every confirm: `root`, `sheet`, `header`, `title`,
44
+ * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). Every
45
+ * confirm is its own `BbDialog`: `root`, `sheet`, `header`, `title`,
55
46
  * `content`, `footer` and `close` are forwarded to it, so a `pt:*` on
56
47
  * `<BbConfirm>` styles every confirm the app opens; `text` and `action` are
57
48
  * bound here.
@@ -7,13 +7,13 @@
7
7
  ```vue
8
8
  <template>
9
9
  <template v-if="owns">
10
- <!-- In open order; the confirm after them, so one opened later sits on top. -->
10
+ <!-- In open order; the confirms after them, so one opened later sits on top. -->
11
11
  <BbHostOpening
12
12
  v-for="opening in openings"
13
13
  :key="opening.key"
14
14
  :opening="opening"
15
15
  />
16
- <BbConfirm />
16
+ <BbConfirmHost />
17
17
  <BbToast />
18
18
  </template>
19
19
  </template>
@@ -37,7 +37,7 @@ import {
37
37
  startOpeningsGrace,
38
38
  stopOpeningsGrace,
39
39
  } from '@/composables/hostOpenings';
40
- import BbConfirm from '../BbConfirm/BbConfirm.vue';
40
+ import BbConfirmHost from '../BbConfirm/BbConfirmHost';
41
41
  import BbHostOpening from './BbHostOpening';
42
42
  import BbToast from '../BbToast/BbToast.vue';
43
43
 
@@ -4240,23 +4240,33 @@ const pruneIncoherent = () => {
4240
4240
  }
4241
4241
  };
4242
4242
 
4243
- /** A cell's value as the table shows it: formatter, then placeholder. */
4244
- const cellContentOf = (column: BbTableColumn<Item>, raw: Item) => {
4243
+ /**
4244
+ * A cell's value as the table shows it: formatter, then placeholder. `kind`
4245
+ * names what came out (Q75.8): a `value`, the column's `placeholder`, or
4246
+ * nothing (`null`: a nil result and no placeholder).
4247
+ */
4248
+ const cellResultOf = (
4249
+ column: BbTableColumn<Item>,
4250
+ raw: Item
4251
+ ): { content: unknown; kind: MappedCell['kind'] } => {
4245
4252
  let content = getItemValue(raw, column.key);
4246
4253
  if (column.formatter && (!isNil(content) || column.formatOnNull !== false)) {
4247
4254
  content = column.formatter(content, column.key, raw);
4248
4255
  }
4249
- if (column.placeholder && isNil(content)) {
4250
- content = column.placeholder;
4251
- }
4252
- return content;
4256
+ if (!isNil(content)) return { content, kind: 'value' };
4257
+ if (column.placeholder)
4258
+ return { content: column.placeholder, kind: 'placeholder' };
4259
+ return { content, kind: null };
4253
4260
  };
4261
+ const cellContentOf = (column: BbTableColumn<Item>, raw: Item) =>
4262
+ cellResultOf(column, raw).content;
4254
4263
 
4255
4264
  const mapColumnToCell = (
4256
4265
  column: BbTableColumn<Item>,
4257
4266
  item: BaseOption,
4258
- content: () => unknown
4267
+ result: () => { content: unknown; kind: MappedCell['kind'] }
4259
4268
  ): MappedCell => {
4269
+ const content = () => result().content;
4260
4270
  const slotName = slotNamesByKey.value[column.key];
4261
4271
  const align = column.align ?? 'left';
4262
4272
 
@@ -4280,6 +4290,9 @@ const mapColumnToCell = (
4280
4290
  get content() {
4281
4291
  return content();
4282
4292
  },
4293
+ get kind() {
4294
+ return result().kind;
4295
+ },
4283
4296
  key: column.key,
4284
4297
  label: column.label,
4285
4298
  slotName,
@@ -4855,7 +4868,7 @@ const buildProjectedItem = (index: number): ProjectedItem => {
4855
4868
  // Read during the ROW's render, so that row's effect subscribes to the
4856
4869
  // fields its cells show and only that row re-renders and re-formats.
4857
4870
  const contents = computed(() =>
4858
- columns.map((column) => cellContentOf(column, base.item))
4871
+ columns.map((column) => cellResultOf(column, base.item))
4859
4872
  );
4860
4873
  // Mapped from `orderedColumns`, so the cells come out in render order with
4861
4874
  // one pass — the old build-then-permute layer was a second array per row.
@@ -7612,7 +7625,9 @@ export type BaseColumn<Item = any> = {
7612
7625
  */
7613
7626
  label: string;
7614
7627
  /**
7615
- * Placeholder used when the pipeline returns null content.
7628
+ * Placeholder used when the pipeline returns null content. Its cell
7629
+ * carries `bb-table__cell--placeholder` (`pt` state `placeholder`); a cell
7630
+ * that shows a value carries `--value`.
7616
7631
  */
7617
7632
  placeholder?: string;
7618
7633
  };
@@ -7866,12 +7881,21 @@ export type BbTableSurfacePtPart =
7866
7881
  * are selected, not all.
7867
7882
  * @state highlighted - Per node, on `row`, its cells and its `expand`: the
7868
7883
  * highlighted row.
7884
+ * @state value - Per node, on a DATA `cell`: the formatter / placeholder
7885
+ * pipeline produced a value (not `null` / `undefined`), slot cells included
7886
+ * (`bb-table__cell--value`). Not on the select, drag or actions cells.
7887
+ * @state placeholder - Per node, on a DATA `cell`: the value was empty and the
7888
+ * column's `placeholder` shows instead, whatever its text
7889
+ * (`bb-table__cell--placeholder`). A cell with an empty value and no
7890
+ * `placeholder` has neither state.
7869
7891
  * @state empty - Component-wide: there are no rows (`bb-table--empty`).
7870
7892
  * @state loading - Component-wide: the table is `loading`.
7871
7893
  */
7872
7894
  export type BbTablePtState =
7873
7895
  | 'loading'
7874
7896
  | 'empty'
7897
+ | 'value'
7898
+ | 'placeholder'
7875
7899
  | 'sorted'
7876
7900
  | 'sortedDesc'
7877
7901
  | 'expanded'
@@ -7901,6 +7925,8 @@ export const BB_TABLE_PT = {
7901
7925
  'foot',
7902
7926
  ],
7903
7927
  states: [
7928
+ 'value',
7929
+ 'placeholder',
7904
7930
  'empty',
7905
7931
  'sorted',
7906
7932
  'sortedDesc',
@@ -8370,6 +8396,8 @@ export type MappedCell = {
8370
8396
  align: string;
8371
8397
  classes: Classes;
8372
8398
  content: any;
8399
+ /** What the formatter / placeholder pipeline produced; `null` when nothing. */
8400
+ kind: 'value' | 'placeholder' | null;
8373
8401
  key: string;
8374
8402
  label: string;
8375
8403
  slotName: string;
@@ -2,16 +2,17 @@ import { usePassthrough as e } from "../../composables/usePassthrough.js";
2
2
  import { useConfig as t } from "../../composables/useConfig.js";
3
3
  import { useId as n } from "../../composables/useId.js";
4
4
  import r from "../BbButton/BbButton.vue.js";
5
- import { TRANSITION_DURATION as i, __registerConfirmHost as a, confirmState as o, namedPortalRegistry as s, processMessage as c } from "../../composables/useConfirm.js";
5
+ import { TRANSITION_DURATION as i, namedPortalRegistry as a, processMessage as o, removeConfirmEntry as s } from "../../composables/useConfirm.js";
6
+ import { CONFIRM_ENTRY as c } from "./confirmEntry.js";
6
7
  import { BB_DIALOG_PT as l } from "../BbDialog/types.js";
7
8
  import u from "../BbDialog/BbDialog.vue.js";
8
9
  import { BB_CONFIRM_PT as d } from "./types.js";
9
- import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createSlots as _, defineComponent as v, mergeProps as y, normalizeProps as b, onMounted as x, onUnmounted as S, openBlock as C, renderList as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useAttrs as O, withCtx as k } from "vue";
10
+ import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createSlots as _, defineComponent as v, inject as y, markRaw as b, mergeProps as x, normalizeProps as S, onMounted as C, openBlock as w, renderList as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useAttrs as k, withCtx as A } from "vue";
10
11
  //#region src/components/BbConfirm/BbConfirm.vue?vue&type=script&setup=true&lang.ts
11
- var A = {
12
+ var j = {
12
13
  key: 0,
13
14
  class: "bb-confirm__content"
14
- }, j = /*@__PURE__*/ v({
15
+ }, M = /*@__PURE__*/ v({
15
16
  inheritAttrs: !1,
16
17
  __name: "BbConfirm",
17
18
  props: {
@@ -36,71 +37,78 @@ var A = {
36
37
  pt: {}
37
38
  },
38
39
  setup(v) {
39
- let j = v, M = O(), N = d.parts.filter((e) => e !== "text" && e !== "action"), P = e({
40
+ let M = v, N = y(c), P = N.state, F = p(() => N.message), I = k(), L = d.parts.filter((e) => e !== "text" && e !== "action"), R = e({
40
41
  component: "BbConfirm",
41
- attrs: M,
42
- props: j,
42
+ attrs: I,
43
+ props: M,
43
44
  parts: d.parts,
44
45
  states: d.states,
45
- active: { open: () => !!o.value.processing }
46
- }), F = p(() => {
47
- let { class: e, ...t } = M, n = {
46
+ active: { open: () => P.processing }
47
+ }), z = p(() => {
48
+ let { class: e, ...t } = I, n = {
48
49
  role: "alertdialog",
49
50
  ...t
50
51
  };
51
- return V.value && !z.value?.title ? {
52
- "aria-labelledby": I,
52
+ return U.value && !F.value?.title ? {
53
+ "aria-labelledby": B,
53
54
  ...n
54
55
  } : n;
55
- }), I = `confirm_text_${n().id.value}`, L = t(), R;
56
- x(() => {
57
- R = a().unregister;
58
- }), S(() => {
59
- R?.();
56
+ }), B = `confirm_text_${n().id.value}`, V = t();
57
+ C(() => {
58
+ P.processing || s(N);
60
59
  });
61
- let z = p(() => o.value.current), B = p(() => o.value.yesBusy || o.value.noBusy || o.value.actionBusy !== null), V = p(() => !!z.value?.text), H = p(() => {
62
- let e = z.value?.portal;
63
- return e ? typeof e == "string" ? s.get(e) ?? null : e : null;
64
- }), U = p(() => V.value || !!H.value), W = p(() => {
65
- let { portal: e, data: t } = z.value ?? {};
60
+ let H = p(() => P.yesBusy || P.noBusy || P.actionBusy !== null), U = p(() => !!F.value?.text), W = {
61
+ data: F.value.data ?? {},
62
+ yes: () => o(!0, !1, N),
63
+ no: () => o(!1, !0, N)
64
+ }, G = p(() => {
65
+ let e = F.value?.portal;
66
+ if (!e) return null;
67
+ if (typeof e != "string") return e;
68
+ let t = a.get(e);
69
+ return t ? b(() => t(W)) : null;
70
+ }), K = p(() => U.value || !!G.value), q = p(() => {
71
+ let { portal: e, data: t } = F.value ?? {};
66
72
  return !e || typeof e == "string" || !t ? {} : t;
67
- }), G = p(() => z.value?.actions !== !1), K = p(() => {
68
- let e = z.value?.actions;
73
+ }), J = p(() => F.value?.actions !== !1), Y = p(() => {
74
+ let e = F.value?.actions;
69
75
  return Array.isArray(e) && e.length ? e : null;
70
- }), q = p(() => z.value?.no || null), J = p(() => z.value?.yes || null), Y = p(() => ["bb-confirm", `bb-confirm--${z.value?.variant ?? "default"}`]), X = (e) => {
71
- e || c(!1);
76
+ }), X = p(() => F.value?.no || null), Z = p(() => F.value?.yes || null), Q = p(() => ["bb-confirm", `bb-confirm--${F.value?.variant ?? "default"}`]), $ = (e) => {
77
+ e || o(!1, !1, N);
72
78
  };
73
- return (e, t) => (C(), m(u, y({
74
- "aria-describedby": V.value && z.value?.title ? I : void 0,
75
- class: Y.value,
76
- "focus-target": z.value?.focusTarget,
77
- fullscreen: z.value?.fullscreen,
78
- "hide-close": B.value || !!z.value?.hideClose,
79
- "model-value": D(o).processing,
80
- persistent: B.value || !!z.value?.persistent,
81
- pt: D(P).forward(D(N), D(l).states)
82
- }, F.value, {
83
- size: z.value?.size ?? D(L).confirm?.defaultSize,
84
- title: z.value?.title,
85
- "transition-duration": D(i),
86
- "onUpdate:modelValue": X
79
+ return (e, t) => (w(), m(u, x({
80
+ "aria-describedby": U.value && F.value?.title ? B : void 0,
81
+ class: Q.value,
82
+ "focus-target": F.value?.focusTarget,
83
+ fullscreen: F.value?.fullscreen,
84
+ "hide-close": H.value || !!F.value?.hideClose,
85
+ "model-value": O(P).processing,
86
+ persistent: H.value || !!F.value?.persistent,
87
+ pt: O(R).forward(O(L), O(l).states)
88
+ }, z.value, {
89
+ size: F.value?.size ?? O(V).confirm?.defaultSize,
90
+ stack: F.value?.stack ?? O("bb-confirm"),
91
+ title: F.value?.title,
92
+ "transition-duration": O(i),
93
+ onHidden: t[2] ||= (e) => O(s)(O(N)),
94
+ "onUpdate:modelValue": $
87
95
  }), _({
88
- default: k(() => [U.value ? (C(), g("div", A, [V.value ? (C(), g("div", y({
96
+ default: A(() => [K.value ? (w(), g("div", j, [U.value ? (w(), g("div", x({
89
97
  key: 0,
90
- id: I,
98
+ id: B,
91
99
  class: "bb-confirm__text"
92
- }, D(P).text), E(z.value?.text), 17)) : (C(), m(T(H.value), b(y({ key: 1 }, W.value)), null, 16))])) : h("", !0)]),
100
+ }, O(R).text), D(F.value?.text), 17)) : (w(), m(E(G.value), S(x({ key: 1 }, q.value)), null, 16))])) : h("", !0)]),
93
101
  _: 2
94
- }, [G.value ? {
102
+ }, [J.value ? {
95
103
  name: "footer",
96
- fn: k(() => [
97
- K.value ? (C(!0), g(f, { key: 0 }, w(K.value, (e, t) => (C(), m(r, y({
104
+ fn: A(() => [
105
+ Y.value ? (w(!0), g(f, { key: 0 }, T(Y.value, (e, t) => (w(), m(r, x({
98
106
  key: t,
99
107
  "append:icon": e["append:icon"],
100
108
  block: e.block,
101
- disabled: D(o).actionBusy !== null && D(o).actionBusy !== t,
109
+ disabled: O(P).actionBusy !== null && O(P).actionBusy !== t,
102
110
  icon: e.icon,
103
- loading: D(o).actionBusy === t,
111
+ loading: O(P).actionBusy === t,
104
112
  "prepend:icon": e["prepend:icon"],
105
113
  size: e.size,
106
114
  text: e.text,
@@ -108,7 +116,7 @@ var A = {
108
116
  onClick: (t) => e.onClick(),
109
117
  class: "bb-confirm__action",
110
118
  ref_for: !0
111
- }, D(P).action), null, 16, [
119
+ }, O(R).action), null, 16, [
112
120
  "append:icon",
113
121
  "block",
114
122
  "disabled",
@@ -120,20 +128,20 @@ var A = {
120
128
  "variant",
121
129
  "onClick"
122
130
  ]))), 128)) : h("", !0),
123
- q.value ? (C(), m(r, y({
131
+ X.value ? (w(), m(r, x({
124
132
  key: 1,
125
- "append:icon": q.value["append:icon"],
126
- block: q.value.block,
127
- disabled: D(o).yesBusy,
128
- icon: q.value.icon,
129
- loading: D(o).noBusy,
130
- "prepend:icon": q.value["prepend:icon"],
131
- size: q.value.size,
132
- text: q.value.text,
133
- variant: q.value.variant,
134
- onClick: t[0] ||= (e) => q.value.onClick(),
133
+ "append:icon": X.value["append:icon"],
134
+ block: X.value.block,
135
+ disabled: O(P).yesBusy,
136
+ icon: X.value.icon,
137
+ loading: O(P).noBusy,
138
+ "prepend:icon": X.value["prepend:icon"],
139
+ size: X.value.size,
140
+ text: X.value.text,
141
+ variant: X.value.variant,
142
+ onClick: t[0] ||= (e) => X.value.onClick(),
135
143
  class: "bb-confirm__action"
136
- }, D(P).action), null, 16, [
144
+ }, O(R).action), null, 16, [
137
145
  "append:icon",
138
146
  "block",
139
147
  "disabled",
@@ -144,20 +152,20 @@ var A = {
144
152
  "text",
145
153
  "variant"
146
154
  ])) : h("", !0),
147
- J.value ? (C(), m(r, y({
155
+ Z.value ? (w(), m(r, x({
148
156
  key: 2,
149
- "append:icon": J.value["append:icon"],
150
- block: J.value.block,
151
- disabled: D(o).noBusy,
152
- icon: J.value.icon,
153
- loading: D(o).yesBusy,
154
- "prepend:icon": J.value["prepend:icon"],
155
- size: J.value.size,
156
- text: J.value.text,
157
- variant: J.value.variant,
158
- onClick: t[1] ||= (e) => J.value.onClick(),
157
+ "append:icon": Z.value["append:icon"],
158
+ block: Z.value.block,
159
+ disabled: O(P).noBusy,
160
+ icon: Z.value.icon,
161
+ loading: O(P).yesBusy,
162
+ "prepend:icon": Z.value["prepend:icon"],
163
+ size: Z.value.size,
164
+ text: Z.value.text,
165
+ variant: Z.value.variant,
166
+ onClick: t[1] ||= (e) => Z.value.onClick(),
159
167
  class: "bb-confirm__action"
160
- }, D(P).action), null, 16, [
168
+ }, O(R).action), null, 16, [
161
169
  "append:icon",
162
170
  "block",
163
171
  "disabled",
@@ -180,10 +188,11 @@ var A = {
180
188
  "persistent",
181
189
  "pt",
182
190
  "size",
191
+ "stack",
183
192
  "title",
184
193
  "transition-duration"
185
194
  ]));
186
195
  }
187
196
  });
188
197
  //#endregion
189
- export { j as default };
198
+ export { M as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The app's confirms, internal to `<BbHost />`: one dialog per `confirm()`
3
+ * call, in open order. Its mount is what `confirm()`'s zero-host grace
4
+ * counts. Attributes reach every confirm (the tests' `pt:*`; `<BbHost />`
5
+ * passes none).
6
+ */
7
+ declare const _default: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
8
+ [key: string]: any;
9
+ }>[], {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
10
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { OPENING as e } from "../../composables/hostOpenings.js";
2
+ import { __registerConfirmHost as t, confirmEntries as n } from "../../composables/useConfirm.js";
3
+ import { CONFIRM_ENTRY as r } from "./confirmEntry.js";
4
+ import i from "./BbConfirm.vue.js";
5
+ import { defineComponent as a, getCurrentInstance as o, h as s, onMounted as c, onUnmounted as l, provide as u } from "vue";
6
+ //#region src/components/BbConfirm/BbConfirmHost.ts
7
+ var d = a({
8
+ name: "BbConfirmOpening",
9
+ props: { entry: {
10
+ type: Object,
11
+ required: !0
12
+ } },
13
+ setup(t) {
14
+ let n = o();
15
+ return t.entry.provides && (n.provides = Object.create(t.entry.provides)), u(e, null), u(r, t.entry), () => s(i);
16
+ }
17
+ }), f = a({
18
+ name: "BbConfirmHost",
19
+ inheritAttrs: !1,
20
+ setup(e, { attrs: r }) {
21
+ let i;
22
+ return c(() => {
23
+ i = t().unregister;
24
+ }), l(() => i?.()), () => n.map((e) => s(d, {
25
+ ...r,
26
+ key: e.key,
27
+ entry: e
28
+ }));
29
+ }
30
+ });
31
+ //#endregion
32
+ export { f as default };
@@ -1,19 +1,15 @@
1
- import { confirmState as e, processMessage as t, registerNamedPortal as n } from "../../composables/useConfirm.js";
2
- import { defineComponent as r, useSlots as i, watchEffect as a } from "vue";
1
+ import { registerNamedPortal as e } from "../../composables/useConfirm.js";
2
+ import { defineComponent as t, useSlots as n, watchEffect as r } from "vue";
3
3
  //#region src/components/BbConfirm/BbConfirmPortal.vue?vue&type=script&setup=true&lang.ts
4
- var o = /*@__PURE__*/ r({
4
+ var i = /*@__PURE__*/ t({
5
5
  __name: "BbConfirmPortal",
6
6
  props: { name: {} },
7
- setup(r) {
8
- let o = r, s = i(), c = () => t(!0), l = () => t(!1, !0);
9
- return a((t) => {
10
- typeof window > "u" || t(n(o.name, () => s.default?.({
11
- yes: c,
12
- no: l,
13
- data: e.value.current?.data ?? {}
14
- })));
7
+ setup(t) {
8
+ let i = t, a = n();
9
+ return r((t) => {
10
+ typeof window > "u" || t(e(i.name, (e) => a.default?.(e)));
15
11
  }), (e, t) => null;
16
12
  }
17
13
  });
18
14
  //#endregion
19
- export { o as default };
15
+ export { i as default };
@@ -0,0 +1,4 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { ConfirmEntry } from '../../composables/useConfirm';
3
+ /** The confirm a `<BbConfirm>` renders, provided by the host per call (Q75.9). */
4
+ export declare const CONFIRM_ENTRY: InjectionKey<ConfirmEntry>;
@@ -0,0 +1,4 @@
1
+ //#region src/components/BbConfirm/confirmEntry.ts
2
+ var e = Symbol.for("bitboss-ui:confirm-entry");
3
+ //#endregion
4
+ export { e as CONFIRM_ENTRY };
@@ -1,7 +1,7 @@
1
1
  import { PtMap, PtValue } from '../../types/passthrough';
2
2
  /**
3
- * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). The host
4
- * renders one `BbDialog` for every confirm: `root`, `sheet`, `header`, `title`,
3
+ * Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). Every
4
+ * confirm is its own `BbDialog`: `root`, `sheet`, `header`, `title`,
5
5
  * `content`, `footer` and `close` are forwarded to it, so a `pt:*` on
6
6
  * `<BbConfirm>` styles every confirm the app opens; `text` and `action` are
7
7
  * bound here.
@@ -1,7 +1,7 @@
1
1
  import { useLogger as e } from "../../composables/useLogger.js";
2
2
  import { hostStateOf as t, registerHost as n } from "../../composables/hostRegistry.js";
3
3
  import { startOpeningsGrace as r, stopOpeningsGrace as i } from "../../composables/hostOpenings.js";
4
- import a from "../BbConfirm/BbConfirm.vue.js";
4
+ import a from "../BbConfirm/BbConfirmHost.js";
5
5
  import o from "./BbHostOpening.js";
6
6
  import s from "../BbToast/BbToast.vue.js";
7
7
  import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createVNode as p, defineComponent as m, getCurrentInstance as h, onBeforeUnmount as g, onMounted as _, openBlock as v, renderList as y, shallowRef as b, unref as x } from "vue";
@@ -21,7 +21,7 @@ var S = /*@__PURE__*/ m({
21
21
  key: e.key,
22
22
  opening: e
23
23
  }, null, 8, ["opening"]))), 128)),
24
- p(a),
24
+ p(x(a)),
25
25
  p(s)
26
26
  ], 64)) : d("", !0);
27
27
  }