@lattice-php/lattice 0.24.0 → 0.26.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.
- package/dist/action/components/action-form.js +37 -5
- package/dist/action/components/action-form.js.map +1 -1
- package/dist/action/components/action-group.js +1 -1
- package/dist/action/components/action-group.js.map +1 -1
- package/dist/action/components/action.js +3 -2
- package/dist/action/components/action.js.map +1 -1
- package/dist/action/hooks/use-action.js +2 -1
- package/dist/action/hooks/use-action.js.map +1 -1
- package/dist/appearance/index.d.ts +1 -1
- package/dist/appearance/index.js +8 -8
- package/dist/appearance/index.js.map +1 -1
- package/dist/chat/components/prompt-input.js +1 -2
- package/dist/chat/components/prompt-input.js.map +1 -1
- package/dist/create-app.js +2 -2
- package/dist/create-app.js.map +1 -1
- package/dist/form/components/base/submit-button.d.ts +4 -3
- package/dist/form/components/base/submit-button.js +2 -1
- package/dist/form/components/base/submit-button.js.map +1 -1
- package/dist/form/components/fields/date-picker-field.js +3 -3
- package/dist/form/components/fields/date-picker-field.js.map +1 -1
- package/dist/form/components/fields/number-input.js +1 -1
- package/dist/form/components/fields/number-input.js.map +1 -1
- package/dist/form/components/fields/rich-editor-field.js +1 -1
- package/dist/form/components/fields/rich-editor-field.js.map +1 -1
- package/dist/form/components/fields/row-action-menu.js +3 -3
- package/dist/form/components/fields/row-action-menu.js.map +1 -1
- package/dist/form/components/fields/row-actions.d.ts +1 -1
- package/dist/form/components/fields/row-actions.js +4 -4
- package/dist/form/components/fields/row-actions.js.map +1 -1
- package/dist/form/components/fields/toggle.js +1 -1
- package/dist/form/components/fields/toggle.js.map +1 -1
- package/dist/form/components/form.js +15 -5
- package/dist/form/components/form.js.map +1 -1
- package/dist/form/components/index.d.ts +1 -0
- package/dist/form/components/index.js +2 -1
- package/dist/form/components/wizard.d.ts +3 -0
- package/dist/form/components/wizard.js +148 -0
- package/dist/form/components/wizard.js.map +1 -0
- package/dist/form/embed.d.ts +1 -1
- package/dist/form/embed.js +2 -2
- package/dist/form/hooks/context.d.ts +7 -2
- package/dist/form/hooks/context.js +4 -1
- package/dist/form/hooks/context.js.map +1 -1
- package/dist/form/index.js +2 -1
- package/dist/form/lib/field-errors.d.ts +2 -0
- package/dist/form/lib/field-errors.js +5 -1
- package/dist/form/lib/field-errors.js.map +1 -1
- package/dist/form/lib/field-props.d.ts +6 -0
- package/dist/form/lib/field-props.js +7 -1
- package/dist/form/lib/field-props.js.map +1 -1
- package/dist/form/lib/prefill-targets.js +2 -3
- package/dist/form/lib/prefill-targets.js.map +1 -1
- package/dist/form/lib/wizard-steps.d.ts +5 -0
- package/dist/form/lib/wizard-steps.js +44 -0
- package/dist/form/lib/wizard-steps.js.map +1 -0
- package/dist/form/plugin.js +4 -1
- package/dist/form/plugin.js.map +1 -1
- package/dist/i18n/translatable.d.ts +1 -0
- package/dist/i18n/translatable.js +4 -1
- package/dist/i18n/translatable.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lattice.css +183 -115
- package/dist/layout/components/callouts.js +3 -2
- package/dist/layout/components/callouts.js.map +1 -1
- package/dist/notifications/components/notification-item.js +10 -5
- package/dist/notifications/components/notification-item.js.map +1 -1
- package/dist/notifications/components/notifications.js +2 -4
- package/dist/notifications/components/notifications.js.map +1 -1
- package/dist/table/components/bulk-bar.js +2 -0
- package/dist/table/components/bulk-bar.js.map +1 -1
- package/dist/table/components/cells/badge-cell.js +3 -6
- package/dist/table/components/cells/badge-cell.js.map +1 -1
- package/dist/table/components/cells/text-cell.js +6 -9
- package/dist/table/components/cells/text-cell.js.map +1 -1
- package/dist/table/components/column-filter-control.js +2 -2
- package/dist/table/components/column-filter-control.js.map +1 -1
- package/dist/table/components/filter-bar.js +1 -1
- package/dist/table/components/filter-bar.js.map +1 -1
- package/dist/table/components/filter-controls.js +4 -1
- package/dist/table/components/filter-controls.js.map +1 -1
- package/dist/table/components/pagination.js +6 -6
- package/dist/table/components/pagination.js.map +1 -1
- package/dist/table/lib/bulk.d.ts +3 -2
- package/dist/table/lib/bulk.js +2 -1
- package/dist/table/lib/bulk.js.map +1 -1
- package/dist/toast/callout.js +6 -3
- package/dist/toast/callout.js.map +1 -1
- package/dist/toast/toast.js +3 -1
- package/dist/toast/toast.js.map +1 -1
- package/dist/toast/toaster.js +2 -2
- package/dist/toast/toaster.js.map +1 -1
- package/dist/toast/variant-styles.js +15 -1
- package/dist/toast/variant-styles.js.map +1 -1
- package/dist/types/generated.d.ts +31 -16
- package/dist/ui/action-menu-context.d.ts +1 -1
- package/dist/ui/action-menu-context.js +1 -1
- package/dist/ui/action-menu-context.js.map +1 -1
- package/dist/ui/affix-group.js +1 -1
- package/dist/ui/affix-group.js.map +1 -1
- package/dist/ui/badge.d.ts +4 -7
- package/dist/ui/badge.js +11 -17
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button.d.ts +6 -5
- package/dist/ui/button.js +154 -15
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/chart-view.js +9 -7
- package/dist/ui/chart-view.js.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/confirm-dialog.d.ts +4 -3
- package/dist/ui/confirm-dialog.js +3 -2
- package/dist/ui/confirm-dialog.js.map +1 -1
- package/dist/ui/control.d.ts +1 -1
- package/dist/ui/control.js +1 -1
- package/dist/ui/control.js.map +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.js +2 -2
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/icon-button.d.ts +3 -3
- package/dist/ui/icon-button.js +6 -6
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/image-preview.js +1 -1
- package/dist/ui/image-preview.js.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +2 -2
- package/dist/ui/info-tooltip.js +1 -1
- package/dist/ui/info-tooltip.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/password-input.js +1 -1
- package/dist/ui/password-input.js.map +1 -1
- package/dist/ui/progress.js +2 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/text.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/vite-typescript-refresh.d.ts +9 -0
- package/dist/vite-typescript-refresh.js +47 -0
- package/dist/vite-typescript-refresh.js.map +1 -0
- package/dist/vite.d.ts +22 -1
- package/dist/vite.js +60 -7
- package/dist/vite.js.map +1 -1
- package/dist-standalone/chunks/{chart-view-DEwGTt9d.js → chart-view-8xEKTUJV.js} +1 -1
- package/dist-standalone/chunks/{date-picker-field-CCQ9nWx0.js → date-picker-field-cdhxtVSG.js} +1 -1
- package/dist-standalone/chunks/{rich-editor-field-B9Nv1qia.js → rich-editor-field-47ov3Bny.js} +1 -1
- package/dist-standalone/lattice.css +1 -1
- package/dist-standalone/lattice.js +15 -15
- package/dist-standalone/manifest.json +5 -5
- package/package.json +1 -1
package/dist/ui/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":[],"sources":["../../resources/js/ui/progress.tsx"],"sourcesContent":["import type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { useLocale } from \"@lattice-php/lattice/i18n\";\nimport { coerceColor, colorValue, namedColor } from \"@lattice-php/lattice/lib/color\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { Size } from \"@lattice-php/lattice/types/generated\";\n\nconst barHeights: Record<Size, string> = {\n xs: \"h-1\",\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-3\",\n xl: \"h-4\",\n \"2xl\": \"h-5\",\n \"3xl\": \"h-6\",\n \"4xl\": \"h-8\",\n};\n\nconst circleDiameters: Record<Size, number> = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 64,\n \"2xl\": 80,\n \"3xl\": 96,\n \"4xl\": 128,\n};\n\nconst circleReadouts: Record<Size, string> = {\n xs: \"text-[0.5rem]\",\n sm: \"text-[0.625rem]\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-base\",\n \"2xl\": \"text-lg\",\n \"3xl\": \"text-xl\",\n \"4xl\": \"text-2xl\",\n};\n\nconst ProgressComponent: RendererComponent<\"progress\"> = ({ node }) => {\n const { value, max,
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../resources/js/ui/progress.tsx"],"sourcesContent":["import type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { useLocale } from \"@lattice-php/lattice/i18n\";\nimport { coerceColor, colorValue, namedColor } from \"@lattice-php/lattice/lib/color\";\nimport { cn } from \"@lattice-php/lattice/lib/utils\";\nimport type { Size } from \"@lattice-php/lattice/types/generated\";\n\nconst barHeights: Record<Size, string> = {\n xs: \"h-1\",\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-3\",\n xl: \"h-4\",\n \"2xl\": \"h-5\",\n \"3xl\": \"h-6\",\n \"4xl\": \"h-8\",\n};\n\nconst circleDiameters: Record<Size, number> = {\n xs: 24,\n sm: 32,\n md: 40,\n lg: 48,\n xl: 64,\n \"2xl\": 80,\n \"3xl\": 96,\n \"4xl\": 128,\n};\n\nconst circleReadouts: Record<Size, string> = {\n xs: \"text-[0.5rem]\",\n sm: \"text-[0.625rem]\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-base\",\n \"2xl\": \"text-lg\",\n \"3xl\": \"text-xl\",\n \"4xl\": \"text-2xl\",\n};\n\nconst ProgressComponent: RendererComponent<\"progress\"> = ({ node }) => {\n const { value, max, shape, showValue, color, size } = node.props;\n const { locale } = useLocale();\n const paint = colorValue(coerceColor(color) ?? namedColor(\"primary\"));\n\n const clamped = max > 0 ? Math.min(Math.max(value, 0), max) : 0;\n const ratio = max > 0 ? clamped / max : 0;\n const percent = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 0,\n style: \"percent\",\n }).format(ratio);\n\n const aria = {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": clamped,\n \"aria-valuetext\": percent,\n role: \"progressbar\",\n } as const;\n\n if (shape === \"circle\") {\n const diameter = circleDiameters[size];\n const strokeWidth = Math.max(3, diameter / 10);\n const radius = (diameter - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n\n return (\n <div {...aria} className=\"relative inline-flex\" data-lattice-progress=\"circle\">\n <svg className=\"-rotate-90\" height={diameter} width={diameter}>\n <circle\n className=\"text-lt-muted\"\n cx={diameter / 2}\n cy={diameter / 2}\n fill=\"none\"\n r={radius}\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n />\n <circle\n cx={diameter / 2}\n cy={diameter / 2}\n fill=\"none\"\n r={radius}\n stroke=\"currentColor\"\n strokeDasharray={circumference}\n strokeDashoffset={circumference * (1 - ratio)}\n strokeLinecap=\"round\"\n strokeWidth={strokeWidth}\n style={{ color: paint }}\n />\n </svg>\n {showValue && (\n <span\n className={cn(\n \"absolute inset-0 flex items-center justify-center font-medium text-lt-fg tabular-nums\",\n circleReadouts[size],\n )}\n >\n {percent}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <div className=\"flex w-full items-center gap-2\" data-lattice-progress=\"bar\">\n <div\n {...aria}\n className={cn(\"w-full overflow-hidden rounded-full bg-lt-muted\", barHeights[size])}\n >\n <div\n className=\"h-full rounded-full\"\n style={{ background: paint, width: `${ratio * 100}%` }}\n />\n </div>\n {showValue && (\n <span className=\"shrink-0 text-lt-muted-fg text-sm tabular-nums\">{percent}</span>\n )}\n </div>\n );\n};\n\nexport default ProgressComponent;\n"],"mappings":";;;;;AAMA,IAAM,aAAmC;CACvC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;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f,MAAK;KACL,GAAG;KACH,QAAO;KACP,iBAAiB;KACjB,kBAAkB,iBAAiB,IAAI;KACvC,eAAc;KACD;KACb,OAAO,EAAE,OAAO,MAAM;IACvB,CAAA,CACE;OACJ,aACC,oBAAC,QAAD;IACE,WAAW,GACT,yFACA,eAAe,KACjB;cAEC;GACG,CAAA,CAEL;;CAET;CAEA,OACE,qBAAC,OAAD;EAAK,WAAU;EAAiC,yBAAsB;YAAtE,CACE,oBAAC,OAAD;GACE,GAAI;GACJ,WAAW,GAAG,mDAAmD,WAAW,KAAK;aAEjF,oBAAC,OAAD;IACE,WAAU;IACV,OAAO;KAAE,YAAY;KAAO,OAAO,GAAG,QAAQ,IAAI;IAAG;GACtD,CAAA;EACE,CAAA,GACJ,aACC,oBAAC,QAAD;GAAM,WAAU;aAAkD;EAAc,CAAA,CAE/E;;AAET"}
|
package/dist/ui/text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import { CopyableText } from "./copyable-text.js";
|
|
3
2
|
import { coerceColor, colorValue, namedColor } from "../lib/color.js";
|
|
3
|
+
import { CopyableText } from "./copyable-text.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region resources/js/ui/text.tsx
|
|
6
6
|
var textAlignments = {
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -11,7 +11,7 @@ var TooltipComponent = ({ node }) => {
|
|
|
11
11
|
if (trigger.length === 0) return /* @__PURE__ */ jsx(InfoTooltip, { content });
|
|
12
12
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
13
13
|
type: "button",
|
|
14
|
-
className: "inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
14
|
+
className: "inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]",
|
|
15
15
|
children: /* @__PURE__ */ jsx(Renderer, { nodes: trigger })
|
|
16
16
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
17
17
|
align: "start",
|
package/dist/ui/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../resources/js/ui/tooltip.tsx"],"sourcesContent":["import { Renderer } from \"@lattice-php/lattice/core/renderer\";\nimport { toNodes } from \"@lattice-php/lattice/core/nodes\";\nimport type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { InfoTooltip } from \"./info-tooltip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nconst TooltipComponent: RendererComponent<\"tooltip\"> = ({ node }) => {\n const content = node.props.content;\n const trigger = toNodes(node.props.trigger);\n\n if (!content) {\n return null;\n }\n\n if (trigger.length === 0) {\n return <InfoTooltip content={content} />;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n className=\"inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../resources/js/ui/tooltip.tsx"],"sourcesContent":["import { Renderer } from \"@lattice-php/lattice/core/renderer\";\nimport { toNodes } from \"@lattice-php/lattice/core/nodes\";\nimport type { RendererComponent } from \"@lattice-php/lattice/core/types\";\nimport { InfoTooltip } from \"./info-tooltip\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nconst TooltipComponent: RendererComponent<\"tooltip\"> = ({ node }) => {\n const content = node.props.content;\n const trigger = toNodes(node.props.trigger);\n\n if (!content) {\n return null;\n }\n\n if (trigger.length === 0) {\n return <InfoTooltip content={content} />;\n }\n\n return (\n <Popover>\n <PopoverTrigger\n type=\"button\"\n className=\"inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]\"\n >\n <Renderer nodes={trigger} />\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"max-w-xs p-3 text-sm [&_a]:underline\"\n dangerouslySetInnerHTML={{ __html: content }}\n />\n </Popover>\n );\n};\n\nexport default TooltipComponent;\n"],"mappings":";;;;;;AAMA,IAAM,oBAAkD,EAAE,WAAW;CACnE,MAAM,UAAU,KAAK,MAAM;CAC3B,MAAM,UAAU,QAAQ,KAAK,MAAM,OAAO;CAE1C,IAAI,CAAC,SACH,OAAO;CAGT,IAAI,QAAQ,WAAW,GACrB,OAAO,oBAAC,aAAD,EAAsB,QAAU,CAAA;CAGzC,OACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EACE,MAAK;EACL,WAAU;YAEV,oBAAC,UAAD,EAAU,OAAO,QAAU,CAAA;CACb,CAAA,GAChB,oBAAC,gBAAD;EACE,OAAM;EACN,WAAU;EACV,yBAAyB,EAAE,QAAQ,QAAQ;CAC5C,CAAA,CACM,EAAA,CAAA;AAEb"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { Logger } from 'vite';
|
|
4
|
+
/**
|
|
5
|
+
* Deliberately absent from `package.json#exports`: unreachable from outside
|
|
6
|
+
* the package even though it compiles into `dist/`. `spawnProcess`/`fileExists`
|
|
7
|
+
* are test seams — the only real caller uses the defaults.
|
|
8
|
+
*/
|
|
9
|
+
export declare function refreshTypeScriptTypes(appRoot: string, logger: Pick<Logger, "info" | "warn">, spawnProcess?: typeof spawn, fileExists?: typeof existsSync): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
//#region resources/js/vite-typescript-refresh.ts
|
|
5
|
+
var MAX_STDERR_CHARS = 500;
|
|
6
|
+
/**
|
|
7
|
+
* Deliberately absent from `package.json#exports`: unreachable from outside
|
|
8
|
+
* the package even though it compiles into `dist/`. `spawnProcess`/`fileExists`
|
|
9
|
+
* are test seams — the only real caller uses the defaults.
|
|
10
|
+
*/
|
|
11
|
+
function refreshTypeScriptTypes(appRoot, logger, spawnProcess = spawn, fileExists = existsSync) {
|
|
12
|
+
if (!fileExists(path.join(appRoot, "artisan"))) return;
|
|
13
|
+
const child = spawnProcess("php", ["artisan", "lattice:typescript"], {
|
|
14
|
+
cwd: appRoot,
|
|
15
|
+
stdio: [
|
|
16
|
+
"ignore",
|
|
17
|
+
"ignore",
|
|
18
|
+
"pipe"
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
let stderr = "";
|
|
22
|
+
let warned = false;
|
|
23
|
+
const warnOnce = (message) => {
|
|
24
|
+
if (warned) return;
|
|
25
|
+
warned = true;
|
|
26
|
+
logger.warn(message);
|
|
27
|
+
};
|
|
28
|
+
child.stderr?.on("data", (chunk) => {
|
|
29
|
+
if (stderr.length < MAX_STDERR_CHARS) stderr += chunk.toString();
|
|
30
|
+
});
|
|
31
|
+
child.stderr?.on("error", () => {});
|
|
32
|
+
child.on("error", (error) => {
|
|
33
|
+
warnOnce(`[lattice] could not refresh TypeScript types: ${error.message}`);
|
|
34
|
+
});
|
|
35
|
+
child.on("exit", (code) => {
|
|
36
|
+
if (code === 0) logger.info("[lattice] refreshed TypeScript types");
|
|
37
|
+
});
|
|
38
|
+
child.on("close", (code) => {
|
|
39
|
+
if (code === 0) return;
|
|
40
|
+
const detail = stderr.trim().slice(0, MAX_STDERR_CHARS);
|
|
41
|
+
warnOnce(`[lattice] php artisan lattice:typescript exited with code ${code}${detail ? `: ${detail}` : ""}`);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { refreshTypeScriptTypes };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=vite-typescript-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-typescript-refresh.js","names":[],"sources":["../resources/js/vite-typescript-refresh.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport type { Logger } from \"vite\";\n\nconst MAX_STDERR_CHARS = 500;\n\n/**\n * Deliberately absent from `package.json#exports`: unreachable from outside\n * the package even though it compiles into `dist/`. `spawnProcess`/`fileExists`\n * are test seams — the only real caller uses the defaults.\n */\nexport function refreshTypeScriptTypes(\n appRoot: string,\n logger: Pick<Logger, \"info\" | \"warn\">,\n spawnProcess: typeof spawn = spawn,\n fileExists: typeof existsSync = existsSync,\n): void {\n if (!fileExists(path.join(appRoot, \"artisan\"))) {\n return;\n }\n\n const child = spawnProcess(\"php\", [\"artisan\", \"lattice:typescript\"], {\n cwd: appRoot,\n stdio: [\"ignore\", \"ignore\", \"pipe\"],\n });\n\n let stderr = \"\";\n let warned = false;\n\n const warnOnce = (message: string): void => {\n if (warned) {\n return;\n }\n\n warned = true;\n logger.warn(message);\n };\n\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n if (stderr.length < MAX_STDERR_CHARS) {\n stderr += chunk.toString();\n }\n });\n\n // An unhandled \"error\" on the piped stream (e.g. EPIPE) would crash the dev server.\n child.stderr?.on(\"error\", () => {});\n\n child.on(\"error\", (error) => {\n warnOnce(`[lattice] could not refresh TypeScript types: ${error.message}`);\n });\n\n child.on(\"exit\", (code) => {\n if (code === 0) {\n logger.info(\"[lattice] refreshed TypeScript types\");\n }\n });\n\n // \"exit\" can fire before stderr has flushed; \"close\" only fires once all stdio has drained.\n child.on(\"close\", (code) => {\n if (code === 0) {\n return;\n }\n\n const detail = stderr.trim().slice(0, MAX_STDERR_CHARS);\n\n warnOnce(\n `[lattice] php artisan lattice:typescript exited with code ${code}${detail ? `: ${detail}` : \"\"}`,\n );\n });\n}\n"],"mappings":";;;;AAKA,IAAM,mBAAmB;;;;;;AAOzB,SAAgB,uBACd,SACA,QACA,eAA6B,OAC7B,aAAgC,YAC1B;CACN,IAAI,CAAC,WAAW,KAAK,KAAK,SAAS,SAAS,CAAC,GAC3C;CAGF,MAAM,QAAQ,aAAa,OAAO,CAAC,WAAW,oBAAoB,GAAG;EACnE,KAAK;EACL,OAAO;GAAC;GAAU;GAAU;EAAM;CACpC,CAAC;CAED,IAAI,SAAS;CACb,IAAI,SAAS;CAEb,MAAM,YAAY,YAA0B;EAC1C,IAAI,QACF;EAGF,SAAS;EACT,OAAO,KAAK,OAAO;CACrB;CAEA,MAAM,QAAQ,GAAG,SAAS,UAAkB;EAC1C,IAAI,OAAO,SAAS,kBAClB,UAAU,MAAM,SAAS;CAE7B,CAAC;CAGD,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC;CAElC,MAAM,GAAG,UAAU,UAAU;EAC3B,SAAS,iDAAiD,MAAM,SAAS;CAC3E,CAAC;CAED,MAAM,GAAG,SAAS,SAAS;EACzB,IAAI,SAAS,GACX,OAAO,KAAK,sCAAsC;CAEtD,CAAC;CAGD,MAAM,GAAG,UAAU,SAAS;EAC1B,IAAI,SAAS,GACX;EAGF,MAAM,SAAS,OAAO,KAAK,EAAE,MAAM,GAAG,gBAAgB;EAEtD,SACE,6DAA6D,OAAO,SAAS,KAAK,WAAW,IAC/F;CACF,CAAC;AACH"}
|
package/dist/vite.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export type LatticeViteOptions = {
|
|
|
19
19
|
icons?: boolean | LatticeViteIconsOptions;
|
|
20
20
|
root?: string;
|
|
21
21
|
source?: boolean;
|
|
22
|
+
/** Refresh generated TypeScript types via the dev server. Defaults to `true`. */
|
|
23
|
+
typescript?: boolean;
|
|
22
24
|
};
|
|
23
25
|
export declare function lattice(options?: LatticeViteOptions): PluginOption[];
|
|
24
26
|
/** A Composer package that contributes a Lattice component plugin. */
|
|
@@ -38,6 +40,14 @@ type InstalledPackage = {
|
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
};
|
|
43
|
+
type RootPackageJson = {
|
|
44
|
+
name?: string;
|
|
45
|
+
extra?: {
|
|
46
|
+
lattice?: {
|
|
47
|
+
plugin?: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
41
51
|
/**
|
|
42
52
|
* Resolve every Composer package that declares `extra.lattice.plugin` into an
|
|
43
53
|
* absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the
|
|
@@ -46,7 +56,18 @@ type InstalledPackage = {
|
|
|
46
56
|
export declare function collectComponentPackages(installed: {
|
|
47
57
|
packages?: InstalledPackage[];
|
|
48
58
|
} | InstalledPackage[], installPathsRelativeTo: string): LatticeComponentPackage[];
|
|
49
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Resolve the composer ROOT project's own `extra.lattice.plugin` — Composer
|
|
61
|
+
* never lists the root package in `installed.json`, so a component package
|
|
62
|
+
* declaring the plugin entry in its own composer.json would otherwise be
|
|
63
|
+
* invisible to its own dev server (e.g. inside a testbench workbench, where
|
|
64
|
+
* the package itself is the app root).
|
|
65
|
+
*/
|
|
66
|
+
export declare function collectRootComponentPackage(composerJson: RootPackageJson, appRoot: string): LatticeComponentPackage[];
|
|
67
|
+
/**
|
|
68
|
+
* Read `<appRoot>/vendor/composer/installed.json` and `<appRoot>/composer.json`
|
|
69
|
+
* and collect every component package they contribute.
|
|
70
|
+
*/
|
|
50
71
|
export declare function discoverComponentPackages(appRoot: string): LatticeComponentPackage[];
|
|
51
72
|
/**
|
|
52
73
|
* Exposes the discovered component packages as `virtual:lattice/plugins` — a
|
package/dist/vite.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { refreshTypeScriptTypes } from "./vite-typescript-refresh.js";
|
|
1
2
|
import { readFileSync } from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { svgSprite } from "@lattice-php/vite-svg-sprite";
|
|
@@ -8,7 +9,8 @@ function lattice(options = {}) {
|
|
|
8
9
|
const plugins = [
|
|
9
10
|
corePlugin(options),
|
|
10
11
|
optionalPeersPlugin(),
|
|
11
|
-
componentPackagesPlugin(discoverComponentPackages(appRoot))
|
|
12
|
+
componentPackagesPlugin(discoverComponentPackages(appRoot)),
|
|
13
|
+
typescriptPlugin(options)
|
|
12
14
|
];
|
|
13
15
|
const iconOptions = resolveIconOptions(options);
|
|
14
16
|
if (iconOptions) plugins.push(svgSprite(iconOptions));
|
|
@@ -31,16 +33,43 @@ function collectComponentPackages(installed, installPathsRelativeTo) {
|
|
|
31
33
|
}];
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the composer ROOT project's own `extra.lattice.plugin` — Composer
|
|
38
|
+
* never lists the root package in `installed.json`, so a component package
|
|
39
|
+
* declaring the plugin entry in its own composer.json would otherwise be
|
|
40
|
+
* invisible to its own dev server (e.g. inside a testbench workbench, where
|
|
41
|
+
* the package itself is the app root).
|
|
42
|
+
*/
|
|
43
|
+
function collectRootComponentPackage(composerJson, appRoot) {
|
|
44
|
+
const entry = composerJson.extra?.lattice?.plugin;
|
|
45
|
+
if (typeof entry !== "string" || typeof composerJson.name !== "string") return [];
|
|
46
|
+
return [{
|
|
47
|
+
name: composerJson.name,
|
|
48
|
+
dir: appRoot,
|
|
49
|
+
plugin: path.resolve(appRoot, entry)
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Read `<appRoot>/vendor/composer/installed.json` and `<appRoot>/composer.json`
|
|
54
|
+
* and collect every component package they contribute.
|
|
55
|
+
*/
|
|
35
56
|
function discoverComponentPackages(appRoot) {
|
|
36
57
|
const composerDir = path.resolve(appRoot, "vendor/composer");
|
|
37
|
-
let
|
|
58
|
+
let installed = [];
|
|
59
|
+
try {
|
|
60
|
+
const raw = readFileSync(path.join(composerDir, "installed.json"), "utf8");
|
|
61
|
+
installed = collectComponentPackages(JSON.parse(raw), composerDir);
|
|
62
|
+
} catch {
|
|
63
|
+
installed = [];
|
|
64
|
+
}
|
|
65
|
+
let root = [];
|
|
38
66
|
try {
|
|
39
|
-
raw = readFileSync(path.join(
|
|
67
|
+
const raw = readFileSync(path.join(appRoot, "composer.json"), "utf8");
|
|
68
|
+
root = collectRootComponentPackage(JSON.parse(raw), appRoot);
|
|
40
69
|
} catch {
|
|
41
|
-
|
|
70
|
+
root = [];
|
|
42
71
|
}
|
|
43
|
-
return
|
|
72
|
+
return [...installed, ...root];
|
|
44
73
|
}
|
|
45
74
|
var VIRTUAL_PLUGINS_ID = "virtual:lattice/plugins";
|
|
46
75
|
var RESOLVED_VIRTUAL_PLUGINS_ID = `\0${VIRTUAL_PLUGINS_ID}`;
|
|
@@ -133,6 +162,30 @@ function optionalPeersPlugin() {
|
|
|
133
162
|
}
|
|
134
163
|
};
|
|
135
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Refreshes `node.props` typings from the app's own `php artisan
|
|
167
|
+
* lattice:typescript` whenever the dev server starts — installing or updating
|
|
168
|
+
* a component package would otherwise leave its generated types stale until
|
|
169
|
+
* someone remembers to run the command by hand. Dev-server only: a production
|
|
170
|
+
* build machine may not have PHP installed, and the generated file is a dev
|
|
171
|
+
* ergonomics artifact, not a build input.
|
|
172
|
+
*
|
|
173
|
+
* Module-private like its siblings `optionalPeersPlugin`/`corePlugin` — the
|
|
174
|
+
* `refreshTypeScriptTypes` DI seam it defers to lives in
|
|
175
|
+
* `./vite-typescript-refresh`, which isn't part of the published `vite`
|
|
176
|
+
* subpath either (see that module for why).
|
|
177
|
+
*/
|
|
178
|
+
function typescriptPlugin(options) {
|
|
179
|
+
return {
|
|
180
|
+
name: "lattice:typescript",
|
|
181
|
+
apply: "serve",
|
|
182
|
+
configureServer(server) {
|
|
183
|
+
if ((options.typescript ?? true) === false) return;
|
|
184
|
+
const { appRoot } = resolveRoots(options);
|
|
185
|
+
refreshTypeScriptTypes(appRoot, server.config.logger);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
136
189
|
function resolveIconOptions(options) {
|
|
137
190
|
const icons = options.icons ?? true;
|
|
138
191
|
if (icons === false) return null;
|
|
@@ -160,6 +213,6 @@ function resolveRoots(options) {
|
|
|
160
213
|
};
|
|
161
214
|
}
|
|
162
215
|
//#endregion
|
|
163
|
-
export { collectComponentPackages, componentPackagesPlugin, discoverComponentPackages, lattice, latticeConfig, resolveIconOptions };
|
|
216
|
+
export { collectComponentPackages, collectRootComponentPackage, componentPackagesPlugin, discoverComponentPackages, lattice, latticeConfig, resolveIconOptions };
|
|
164
217
|
|
|
165
218
|
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","names":[],"sources":["../resources/js/vite.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { svgSprite } from \"@lattice-php/vite-svg-sprite\";\nimport type { IconTypesOptions, SvgSpriteOptions } from \"@lattice-php/vite-svg-sprite\";\nimport { searchForWorkspaceRoot } from \"vite\";\nimport type { Plugin, PluginOption, UserConfig } from \"vite\";\n\ntype InlineDependency = string | RegExp;\n\ntype ConfigWithTest = UserConfig & {\n test?: {\n server?: {\n deps?: {\n inline?: InlineDependency[];\n };\n };\n };\n};\n\nexport type LatticeViteIconsOptions = Omit<SvgSpriteOptions, \"dts\" | \"iconDirs\"> & {\n dirs?: string[];\n dts?: Partial<IconTypesOptions> | false;\n};\n\nexport type LatticeViteOptions = {\n appRoot?: string;\n icons?: boolean | LatticeViteIconsOptions;\n root?: string;\n source?: boolean;\n};\n\ntype Roots = {\n appRoot: string;\n root: string;\n};\n\nexport function lattice(options: LatticeViteOptions = {}): PluginOption[] {\n const { appRoot } = resolveRoots(options);\n const plugins: PluginOption[] = [\n corePlugin(options),\n optionalPeersPlugin(),\n componentPackagesPlugin(discoverComponentPackages(appRoot)),\n ];\n const iconOptions = resolveIconOptions(options);\n\n if (iconOptions) {\n plugins.push(svgSprite(iconOptions));\n }\n\n return plugins;\n}\n\n/** A Composer package that contributes a Lattice component plugin. */\nexport type LatticeComponentPackage = {\n name: string;\n /** Absolute path to the package's installed directory. */\n dir: string;\n /** Absolute path to the package's JS plugin entry (its `createPlugin(...)`). */\n plugin: string;\n};\n\ntype InstalledPackage = {\n name: string;\n \"install-path\"?: string;\n extra?: { lattice?: { plugin?: string } };\n};\n\n/**\n * Resolve every Composer package that declares `extra.lattice.plugin` into an\n * absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the\n * dir `installed.json` records its `install-path`s against).\n */\nexport function collectComponentPackages(\n installed: { packages?: InstalledPackage[] } | InstalledPackage[],\n installPathsRelativeTo: string,\n): LatticeComponentPackage[] {\n const packages = Array.isArray(installed) ? installed : (installed.packages ?? []);\n\n return packages.flatMap((pkg) => {\n const entry = pkg.extra?.lattice?.plugin;\n\n if (typeof entry !== \"string\") {\n return [];\n }\n\n const dir = path.resolve(installPathsRelativeTo, pkg[\"install-path\"] ?? `../${pkg.name}`);\n\n return [{ name: pkg.name, dir, plugin: path.resolve(dir, entry) }];\n });\n}\n\n/** Read `<appRoot>/vendor/composer/installed.json` and collect component packages. */\nexport function discoverComponentPackages(appRoot: string): LatticeComponentPackage[] {\n const composerDir = path.resolve(appRoot, \"vendor/composer\");\n\n let raw: string;\n\n try {\n raw = readFileSync(path.join(composerDir, \"installed.json\"), \"utf8\");\n } catch {\n return [];\n }\n\n return collectComponentPackages(JSON.parse(raw), composerDir);\n}\n\nconst VIRTUAL_PLUGINS_ID = \"virtual:lattice/plugins\";\nconst RESOLVED_VIRTUAL_PLUGINS_ID = `\\0${VIRTUAL_PLUGINS_ID}`;\n\n/**\n * Exposes the discovered component packages as `virtual:lattice/plugins` — a\n * module whose default export is the array of their `createPlugin(...)` results,\n * ready for `extendRegistry(registry, ...plugins)`. Also grants Vite filesystem\n * access to each package dir so its source compiles from `vendor/` (or a symlink).\n */\nexport function componentPackagesPlugin(packages: LatticeComponentPackage[]): Plugin {\n return {\n name: \"lattice:component-packages\",\n config(config) {\n if (packages.length === 0) {\n return {};\n }\n\n const workspaceRoot = searchForWorkspaceRoot(config.root ?? process.cwd());\n\n return { server: { fs: { allow: [workspaceRoot, ...packages.map((pkg) => pkg.dir)] } } };\n },\n resolveId(id) {\n return id === VIRTUAL_PLUGINS_ID ? RESOLVED_VIRTUAL_PLUGINS_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_VIRTUAL_PLUGINS_ID) {\n return null;\n }\n\n const imports = packages\n .map((pkg, index) => `import p${index} from ${JSON.stringify(pkg.plugin)};`)\n .join(\"\\n\");\n const list = packages.map((_, index) => `p${index}`).join(\", \");\n\n return `${imports}\\nexport default [${list}];\\n`;\n },\n };\n}\n\nexport function latticeConfig(options: LatticeViteOptions = {}): ConfigWithTest {\n const { appRoot, root } = resolveRoots(options);\n\n return {\n resolve: {\n alias: options.source\n ? {\n \"@lattice-php/lattice/css\": path.resolve(root, \"resources/css/lattice.css\"),\n \"@lattice-php/lattice\": path.resolve(root, \"resources/js\"),\n }\n : {\n react: path.resolve(appRoot, \"node_modules/react\"),\n \"react-dom\": path.resolve(appRoot, \"node_modules/react-dom\"),\n },\n dedupe: [\"@inertiajs/react\", \"react\", \"react-dom\"],\n },\n server: options.source\n ? {\n fs: {\n allow: [searchForWorkspaceRoot(appRoot), root],\n },\n }\n : undefined,\n test: {\n server: {\n deps: {\n inline: [\n \"@lattice-php/lattice\",\n /[/\\\\]lattice[/\\\\]dist[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@radix-ui[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@tiptap[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]react-i18next[/\\\\]/,\n ],\n },\n },\n },\n };\n}\n\nfunction corePlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice\",\n config() {\n return latticeConfig(options);\n },\n };\n}\n\nconst OPTIONAL_PEER_STUB_PREFIX = \"\\0lattice-optional-peer/\";\n\n/**\n * Real-time listeners statically import their optional Echo peers. A consumer\n * that never uses real-time should still build, so stub a missing peer with\n * hooks that throw — the `RealtimeListeners` error boundary then degrades\n * gracefully and warns to install the peer, exactly as when it is absent.\n */\nconst OPTIONAL_PEER_STUBS: Record<string, string> = {\n \"@laravel/echo-react\": [\n \"const missing = () => {\",\n \" throw new Error(\",\n ' \"[lattice] Real-time listeners require @laravel/echo-react. Install it and call configureEcho().\",',\n \" );\",\n \"};\",\n \"export const useEcho = missing;\",\n \"export const useEchoPublic = missing;\",\n \"export const useEchoPresence = missing;\",\n \"export const useEchoNotification = missing;\",\n ].join(\"\\n\"),\n};\n\nfunction optionalPeersPlugin(): Plugin {\n return {\n name: \"lattice:optional-peers\",\n enforce: \"pre\",\n async resolveId(id) {\n if (!Object.prototype.hasOwnProperty.call(OPTIONAL_PEER_STUBS, id)) {\n return null;\n }\n\n const installed = await this.resolve(id, undefined, { skipSelf: true });\n\n return installed ? null : `${OPTIONAL_PEER_STUB_PREFIX}${id}`;\n },\n load(id) {\n if (!id.startsWith(OPTIONAL_PEER_STUB_PREFIX)) {\n return null;\n }\n\n return OPTIONAL_PEER_STUBS[id.slice(OPTIONAL_PEER_STUB_PREFIX.length)] ?? null;\n },\n };\n}\n\nexport function resolveIconOptions(options: LatticeViteOptions): SvgSpriteOptions | null {\n const icons = options.icons ?? true;\n\n if (icons === false) {\n return null;\n }\n\n const { root } = resolveRoots(options);\n const iconOptions = icons === true ? {} : icons;\n const { dirs = [], dts, ...spriteOptions } = iconOptions;\n const defaultTypes = {\n file: \"resources/js/types/sprite-icons.ts\",\n augmentModule: \"@lattice-php/lattice\",\n augmentInterface: \"KnownIcons\",\n };\n\n return {\n ...spriteOptions,\n iconDirs: [path.resolve(root, \"resources/icons\"), ...dirs],\n ...(dts === false ? {} : { dts: { ...defaultTypes, ...dts } }),\n };\n}\n\nfunction resolveRoots(options: LatticeViteOptions): Roots {\n const appRoot = options.appRoot ?? process.cwd();\n const root = options.root ?? path.resolve(appRoot, \"vendor/lattice-php/lattice\");\n\n return { appRoot, root };\n}\n"],"mappings":";;;;;AAoCA,S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AqB,EAAE,GAC/D,OAAO;GAKT,OAAO,MAFiB,KAAK,QAAQ,IAAI,KAAA,GAAW,EAAE,UAAU,KAAK,CAAC,IAEnD,OAAO,GAAG,4BAA4B;EAC3D;EACA,KAAK,IAAI;GACP,IAAI,CAAC,GAAG,WAAW,yBAAyB,GAC1C,OAAO;GAGT,OAAO,oBAAoB,GAAG,MAAM,EAAgC,MAAM;EAC5E;CACF;AACF;AAEA,SAAgB,mBAAmB,SAAsD;CACvF,MAAM,QAAQ,QAAQ,SAAS;CAE/B,IAAI,UAAU,OACZ,OAAO;CAGT,MAAM,EAAE,SAAS,aAAa,OAAO;CAErC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,GAAG,kBADP,UAAU,OAAO,CAAC,IAAI;CAE1C,MAAM,eAAe;EACnB,MAAM;EACN,eAAe;EACf,kBAAkB;CACpB;CAEA,OAAO;EACL,GAAG;EACH,UAAU,CAAC,KAAK,QAAQ,MAAM,iBAAiB,GAAG,GAAG,IAAI;EACzD,GAAI,QAAQ,QAAQ,CAAC,IAAI,EAAE,KAAK;GAAE,GAAG;GAAc,GAAG;EAAI,EAAE;CAC9D;AACF;AAEA,SAAS,aAAa,SAAoC;CACxD,MAAM,UAAU,QAAQ,WAAW,QAAQ,IAAI;CAG/C,OAAO;EAAE;EAAS,MAFL,QAAQ,QAAQ,KAAK,QAAQ,SAAS,4BAA4B;CAExD;AACzB"}
|
|
1
|
+
{"version":3,"file":"vite.js","names":[],"sources":["../resources/js/vite.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { svgSprite } from \"@lattice-php/vite-svg-sprite\";\nimport type { IconTypesOptions, SvgSpriteOptions } from \"@lattice-php/vite-svg-sprite\";\nimport { searchForWorkspaceRoot } from \"vite\";\nimport type { Plugin, PluginOption, UserConfig } from \"vite\";\nimport { refreshTypeScriptTypes } from \"./vite-typescript-refresh\";\n\ntype InlineDependency = string | RegExp;\n\ntype ConfigWithTest = UserConfig & {\n test?: {\n server?: {\n deps?: {\n inline?: InlineDependency[];\n };\n };\n };\n};\n\nexport type LatticeViteIconsOptions = Omit<SvgSpriteOptions, \"dts\" | \"iconDirs\"> & {\n dirs?: string[];\n dts?: Partial<IconTypesOptions> | false;\n};\n\nexport type LatticeViteOptions = {\n appRoot?: string;\n icons?: boolean | LatticeViteIconsOptions;\n root?: string;\n source?: boolean;\n /** Refresh generated TypeScript types via the dev server. Defaults to `true`. */\n typescript?: boolean;\n};\n\ntype Roots = {\n appRoot: string;\n root: string;\n};\n\nexport function lattice(options: LatticeViteOptions = {}): PluginOption[] {\n const { appRoot } = resolveRoots(options);\n const plugins: PluginOption[] = [\n corePlugin(options),\n optionalPeersPlugin(),\n componentPackagesPlugin(discoverComponentPackages(appRoot)),\n typescriptPlugin(options),\n ];\n const iconOptions = resolveIconOptions(options);\n\n if (iconOptions) {\n plugins.push(svgSprite(iconOptions));\n }\n\n return plugins;\n}\n\n/** A Composer package that contributes a Lattice component plugin. */\nexport type LatticeComponentPackage = {\n name: string;\n /** Absolute path to the package's installed directory. */\n dir: string;\n /** Absolute path to the package's JS plugin entry (its `createPlugin(...)`). */\n plugin: string;\n};\n\ntype InstalledPackage = {\n name: string;\n \"install-path\"?: string;\n extra?: { lattice?: { plugin?: string } };\n};\n\ntype RootPackageJson = {\n name?: string;\n extra?: { lattice?: { plugin?: string } };\n};\n\n/**\n * Resolve every Composer package that declares `extra.lattice.plugin` into an\n * absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the\n * dir `installed.json` records its `install-path`s against).\n */\nexport function collectComponentPackages(\n installed: { packages?: InstalledPackage[] } | InstalledPackage[],\n installPathsRelativeTo: string,\n): LatticeComponentPackage[] {\n const packages = Array.isArray(installed) ? installed : (installed.packages ?? []);\n\n return packages.flatMap((pkg) => {\n const entry = pkg.extra?.lattice?.plugin;\n\n if (typeof entry !== \"string\") {\n return [];\n }\n\n const dir = path.resolve(installPathsRelativeTo, pkg[\"install-path\"] ?? `../${pkg.name}`);\n\n return [{ name: pkg.name, dir, plugin: path.resolve(dir, entry) }];\n });\n}\n\n/**\n * Resolve the composer ROOT project's own `extra.lattice.plugin` — Composer\n * never lists the root package in `installed.json`, so a component package\n * declaring the plugin entry in its own composer.json would otherwise be\n * invisible to its own dev server (e.g. inside a testbench workbench, where\n * the package itself is the app root).\n */\nexport function collectRootComponentPackage(\n composerJson: RootPackageJson,\n appRoot: string,\n): LatticeComponentPackage[] {\n const entry = composerJson.extra?.lattice?.plugin;\n\n if (typeof entry !== \"string\" || typeof composerJson.name !== \"string\") {\n return [];\n }\n\n return [{ name: composerJson.name, dir: appRoot, plugin: path.resolve(appRoot, entry) }];\n}\n\n/**\n * Read `<appRoot>/vendor/composer/installed.json` and `<appRoot>/composer.json`\n * and collect every component package they contribute.\n */\nexport function discoverComponentPackages(appRoot: string): LatticeComponentPackage[] {\n const composerDir = path.resolve(appRoot, \"vendor/composer\");\n\n let installed: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(composerDir, \"installed.json\"), \"utf8\");\n installed = collectComponentPackages(JSON.parse(raw), composerDir);\n } catch {\n installed = [];\n }\n\n let root: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(appRoot, \"composer.json\"), \"utf8\");\n root = collectRootComponentPackage(JSON.parse(raw), appRoot);\n } catch {\n root = [];\n }\n\n return [...installed, ...root];\n}\n\nconst VIRTUAL_PLUGINS_ID = \"virtual:lattice/plugins\";\nconst RESOLVED_VIRTUAL_PLUGINS_ID = `\\0${VIRTUAL_PLUGINS_ID}`;\n\n/**\n * Exposes the discovered component packages as `virtual:lattice/plugins` — a\n * module whose default export is the array of their `createPlugin(...)` results,\n * ready for `extendRegistry(registry, ...plugins)`. Also grants Vite filesystem\n * access to each package dir so its source compiles from `vendor/` (or a symlink).\n */\nexport function componentPackagesPlugin(packages: LatticeComponentPackage[]): Plugin {\n return {\n name: \"lattice:component-packages\",\n config(config) {\n if (packages.length === 0) {\n return {};\n }\n\n const workspaceRoot = searchForWorkspaceRoot(config.root ?? process.cwd());\n\n return { server: { fs: { allow: [workspaceRoot, ...packages.map((pkg) => pkg.dir)] } } };\n },\n resolveId(id) {\n return id === VIRTUAL_PLUGINS_ID ? RESOLVED_VIRTUAL_PLUGINS_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_VIRTUAL_PLUGINS_ID) {\n return null;\n }\n\n const imports = packages\n .map((pkg, index) => `import p${index} from ${JSON.stringify(pkg.plugin)};`)\n .join(\"\\n\");\n const list = packages.map((_, index) => `p${index}`).join(\", \");\n\n return `${imports}\\nexport default [${list}];\\n`;\n },\n };\n}\n\nexport function latticeConfig(options: LatticeViteOptions = {}): ConfigWithTest {\n const { appRoot, root } = resolveRoots(options);\n\n return {\n resolve: {\n alias: options.source\n ? {\n \"@lattice-php/lattice/css\": path.resolve(root, \"resources/css/lattice.css\"),\n \"@lattice-php/lattice\": path.resolve(root, \"resources/js\"),\n }\n : {\n react: path.resolve(appRoot, \"node_modules/react\"),\n \"react-dom\": path.resolve(appRoot, \"node_modules/react-dom\"),\n },\n dedupe: [\"@inertiajs/react\", \"react\", \"react-dom\"],\n },\n server: options.source\n ? {\n fs: {\n allow: [searchForWorkspaceRoot(appRoot), root],\n },\n }\n : undefined,\n test: {\n server: {\n deps: {\n inline: [\n \"@lattice-php/lattice\",\n /[/\\\\]lattice[/\\\\]dist[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@radix-ui[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@tiptap[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]react-i18next[/\\\\]/,\n ],\n },\n },\n },\n };\n}\n\nfunction corePlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice\",\n config() {\n return latticeConfig(options);\n },\n };\n}\n\nconst OPTIONAL_PEER_STUB_PREFIX = \"\\0lattice-optional-peer/\";\n\n/**\n * Real-time listeners statically import their optional Echo peers. A consumer\n * that never uses real-time should still build, so stub a missing peer with\n * hooks that throw — the `RealtimeListeners` error boundary then degrades\n * gracefully and warns to install the peer, exactly as when it is absent.\n */\nconst OPTIONAL_PEER_STUBS: Record<string, string> = {\n \"@laravel/echo-react\": [\n \"const missing = () => {\",\n \" throw new Error(\",\n ' \"[lattice] Real-time listeners require @laravel/echo-react. Install it and call configureEcho().\",',\n \" );\",\n \"};\",\n \"export const useEcho = missing;\",\n \"export const useEchoPublic = missing;\",\n \"export const useEchoPresence = missing;\",\n \"export const useEchoNotification = missing;\",\n ].join(\"\\n\"),\n};\n\nfunction optionalPeersPlugin(): Plugin {\n return {\n name: \"lattice:optional-peers\",\n enforce: \"pre\",\n async resolveId(id) {\n if (!Object.prototype.hasOwnProperty.call(OPTIONAL_PEER_STUBS, id)) {\n return null;\n }\n\n const installed = await this.resolve(id, undefined, { skipSelf: true });\n\n return installed ? null : `${OPTIONAL_PEER_STUB_PREFIX}${id}`;\n },\n load(id) {\n if (!id.startsWith(OPTIONAL_PEER_STUB_PREFIX)) {\n return null;\n }\n\n return OPTIONAL_PEER_STUBS[id.slice(OPTIONAL_PEER_STUB_PREFIX.length)] ?? null;\n },\n };\n}\n\n/**\n * Refreshes `node.props` typings from the app's own `php artisan\n * lattice:typescript` whenever the dev server starts — installing or updating\n * a component package would otherwise leave its generated types stale until\n * someone remembers to run the command by hand. Dev-server only: a production\n * build machine may not have PHP installed, and the generated file is a dev\n * ergonomics artifact, not a build input.\n *\n * Module-private like its siblings `optionalPeersPlugin`/`corePlugin` — the\n * `refreshTypeScriptTypes` DI seam it defers to lives in\n * `./vite-typescript-refresh`, which isn't part of the published `vite`\n * subpath either (see that module for why).\n */\nfunction typescriptPlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice:typescript\",\n apply: \"serve\",\n configureServer(server) {\n const typescript = options.typescript ?? true;\n\n if (typescript === false) {\n return;\n }\n\n const { appRoot } = resolveRoots(options);\n\n refreshTypeScriptTypes(appRoot, server.config.logger);\n },\n };\n}\n\nexport function resolveIconOptions(options: LatticeViteOptions): SvgSpriteOptions | null {\n const icons = options.icons ?? true;\n\n if (icons === false) {\n return null;\n }\n\n const { root } = resolveRoots(options);\n const iconOptions = icons === true ? {} : icons;\n const { dirs = [], dts, ...spriteOptions } = iconOptions;\n const defaultTypes = {\n file: \"resources/js/types/sprite-icons.ts\",\n augmentModule: \"@lattice-php/lattice\",\n augmentInterface: \"KnownIcons\",\n };\n\n return {\n ...spriteOptions,\n iconDirs: [path.resolve(root, \"resources/icons\"), ...dirs],\n ...(dts === false ? {} : { dts: { ...defaultTypes, ...dts } }),\n };\n}\n\nfunction resolveRoots(options: LatticeViteOptions): Roots {\n const appRoot = options.appRoot ?? process.cwd();\n const root = options.root ?? path.resolve(appRoot, \"vendor/lattice-php/lattice\");\n\n return { appRoot, root };\n}\n"],"mappings":";;;;;;AAuCA,SAAgB,QAAQ,UAA8B,CAAC,GAAmB;CACxE,MAAM,EAAE,YAAY,aAAa,OAAO;CACxC,MAAM,UAA0B;EAC9B,WAAW,OAAO;EAClB,oBAAoB;EACpB,wBAAwB,0BAA0B,OAAO,CAAC;EAC1D,iBAAiB,OAAO;CAC1B;CACA,MAAM,cAAc,mBAAmB,OAAO;CAE9C,IAAI,aACF,QAAQ,KAAK,UAAU,WAAW,CAAC;CAGrC,OAAO;AACT;;;;;;AA2BA,SAAgB,yBACd,WACA,wBAC2B;CAG3B,QAFiB,MAAM,QAAQ,SAAS,IAAI,YAAa,UAAU,YAAY,CAAC,GAEhE,SAAS,QAAQ;EAC/B,MAAM,QAAQ,IAAI,OAAO,SAAS;EAElC,IAAI,OAAO,UAAU,UACnB,OAAO,CAAC;EAGV,MAAM,MAAM,KAAK,QAAQ,wBAAwB,IAAI,mBAAmB,MAAM,IAAI,MAAM;EAExF,OAAO,CAAC;GAAE,MAAM,IAAI;GAAM;GAAK,QAAQ,KAAK,QAAQ,KAAK,KAAK;EAAE,CAAC;CACnE,CAAC;AACH;;;;;;;;AASA,SAAgB,4BACd,cAC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