@once-ui-system/core 1.7.11 → 1.7.13
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/AGENTS.md +53 -0
- package/README.md +27 -0
- package/agent/once-ui-codegen.mdc +27 -0
- package/ai/catalog.json +1650 -0
- package/ai/catalog.seed.json +411 -0
- package/ai/components/Accordion.json +136 -0
- package/ai/components/AccordionGroup.json +128 -0
- package/ai/components/Animation.json +146 -0
- package/ai/components/Arrow.json +128 -0
- package/ai/components/AutoScroll.json +130 -0
- package/ai/components/Avatar.json +133 -0
- package/ai/components/AvatarGroup.json +129 -0
- package/ai/components/Background.json +131 -0
- package/ai/components/Badge.json +132 -0
- package/ai/components/Banner.json +122 -0
- package/ai/components/BarChart.json +123 -0
- package/ai/components/BlobFx.json +125 -0
- package/ai/components/BlockQuote.json +132 -0
- package/ai/components/Button.json +26 -0
- package/ai/components/Card.json +129 -0
- package/ai/components/Carousel.json +134 -0
- package/ai/components/CelebrationFx.json +132 -0
- package/ai/components/ChartHeader.json +130 -0
- package/ai/components/ChartStatus.json +12 -0
- package/ai/components/Checkbox.json +13 -0
- package/ai/components/Chip.json +132 -0
- package/ai/components/CodeBlock.json +122 -0
- package/ai/components/ColorInput.json +13 -0
- package/ai/components/Column.json +128 -0
- package/ai/components/CompareImage.json +126 -0
- package/ai/components/ContextMenu.json +22 -0
- package/ai/components/CountFx.json +82 -0
- package/ai/components/CountdownFx.json +11 -0
- package/ai/components/Cursor.json +9 -0
- package/ai/components/CursorCard.json +128 -0
- package/ai/components/DataTooltip.json +15 -0
- package/ai/components/DateInput.json +21 -0
- package/ai/components/DatePicker.json +143 -0
- package/ai/components/DateRangeInput.json +18 -0
- package/ai/components/DateRangePicker.json +129 -0
- package/ai/components/Dialog.json +134 -0
- package/ai/components/DialogProvider.json +8 -0
- package/ai/components/Dropdown.json +128 -0
- package/ai/components/DropdownWrapper.json +28 -0
- package/ai/components/EmojiPicker.json +129 -0
- package/ai/components/EmojiPickerDropdown.json +13 -0
- package/ai/components/Fade.json +130 -0
- package/ai/components/FadingLettersFx.json +77 -0
- package/ai/components/Feedback.json +132 -0
- package/ai/components/Flex.json +125 -0
- package/ai/components/FlipFx.json +133 -0
- package/ai/components/GlitchFx.json +128 -0
- package/ai/components/Grid.json +121 -0
- package/ai/components/Heading.json +75 -0
- package/ai/components/HeadingLink.json +127 -0
- package/ai/components/HeadingNav.json +124 -0
- package/ai/components/HoloFx.json +128 -0
- package/ai/components/Hover.json +130 -0
- package/ai/components/HoverCard.json +122 -0
- package/ai/components/Icon.json +132 -0
- package/ai/components/IconButton.json +22 -0
- package/ai/components/InfiniteScroll.json +130 -0
- package/ai/components/InlineCode.json +126 -0
- package/ai/components/Input.json +24 -0
- package/ai/components/InteractiveDetails.json +14 -0
- package/ai/components/Kbar.json +10 -0
- package/ai/components/Kbd.json +127 -0
- package/ai/components/Legend.json +14 -0
- package/ai/components/LetterFx.json +14 -0
- package/ai/components/Line.json +125 -0
- package/ai/components/LineBarChart.json +123 -0
- package/ai/components/LineChart.json +123 -0
- package/ai/components/LinearGauge.json +130 -0
- package/ai/components/LinearGradient.json +15 -0
- package/ai/components/List.json +127 -0
- package/ai/components/ListItem.json +77 -0
- package/ai/components/Logo.json +16 -0
- package/ai/components/LogoCloud.json +124 -0
- package/ai/components/Mask.json +131 -0
- package/ai/components/MasonryGrid.json +132 -0
- package/ai/components/MatrixFx.json +135 -0
- package/ai/components/Media.json +142 -0
- package/ai/components/MediaUpload.json +122 -0
- package/ai/components/MegaMenu.json +125 -0
- package/ai/components/MobileMegaMenu.json +125 -0
- package/ai/components/Modal.json +12 -0
- package/ai/components/NavIcon.json +127 -0
- package/ai/components/NumberInput.json +16 -0
- package/ai/components/OTPInput.json +13 -0
- package/ai/components/OgCard.json +135 -0
- package/ai/components/Option.json +137 -0
- package/ai/components/Particle.json +135 -0
- package/ai/components/PasswordInput.json +8 -0
- package/ai/components/PieChart.json +123 -0
- package/ai/components/ProgressBar.json +131 -0
- package/ai/components/Pulse.json +129 -0
- package/ai/components/RadialGauge.json +134 -0
- package/ai/components/RadialGradient.json +16 -0
- package/ai/components/RadioButton.json +17 -0
- package/ai/components/RevealFx.json +131 -0
- package/ai/components/Row.json +128 -0
- package/ai/components/Schema.json +17 -0
- package/ai/components/ScrollContainer.json +126 -0
- package/ai/components/ScrollToTop.json +124 -0
- package/ai/components/Scroller.json +128 -0
- package/ai/components/SegmentedControl.json +132 -0
- package/ai/components/Select.json +21 -0
- package/ai/components/ShineFx.json +80 -0
- package/ai/components/Skeleton.json +129 -0
- package/ai/components/Slider.json +17 -0
- package/ai/components/SmartLink.json +17 -0
- package/ai/components/Spinner.json +127 -0
- package/ai/components/SplitView.json +129 -0
- package/ai/components/StatusIndicator.json +128 -0
- package/ai/components/StyleOverlay.json +126 -0
- package/ai/components/StylePanel.json +125 -0
- package/ai/components/Swiper.json +130 -0
- package/ai/components/Switch.json +20 -0
- package/ai/components/Table.json +140 -0
- package/ai/components/Tag.json +129 -0
- package/ai/components/TagInput.json +12 -0
- package/ai/components/Text.json +72 -0
- package/ai/components/Textarea.json +24 -0
- package/ai/components/ThemeSwitcher.json +122 -0
- package/ai/components/TiltFx.json +126 -0
- package/ai/components/Timeline.json +126 -0
- package/ai/components/Toast.json +13 -0
- package/ai/components/Toaster.json +14 -0
- package/ai/components/ToggleButton.json +24 -0
- package/ai/components/Tooltip.json +129 -0
- package/ai/components/TypeFx.json +15 -0
- package/ai/components/User.json +15 -0
- package/ai/components/UserMenu.json +16 -0
- package/ai/components/WeatherFx.json +133 -0
- package/ai/examples/auth.tsx +105 -0
- package/ai/examples/blocks/Background6.tsx +25 -0
- package/ai/examples/blocks/Chat1.tsx +70 -0
- package/ai/examples/blocks/Dashboard1.tsx +404 -0
- package/ai/examples/blocks/Feed3.tsx +151 -0
- package/ai/examples/blocks/Footer1.tsx +30 -0
- package/ai/examples/blocks/Footer2.tsx +96 -0
- package/ai/examples/blocks/Footer3.tsx +127 -0
- package/ai/examples/blocks/Footer4.tsx +406 -0
- package/ai/examples/blocks/Header1.tsx +370 -0
- package/ai/examples/blocks/Header2.tsx +98 -0
- package/ai/examples/blocks/Header3.tsx +133 -0
- package/ai/examples/blocks/Header4.tsx +123 -0
- package/ai/examples/blocks/Productivity1.tsx +318 -0
- package/ai/examples/blocks/Roadmap1.tsx +133 -0
- package/ai/examples/blocks/Sidebar1.tsx +34 -0
- package/ai/examples/blocks/Sidebar2.tsx +17 -0
- package/ai/examples/blocks/Sidebar4.tsx +92 -0
- package/ai/examples/blocks/Sidebar5.tsx +73 -0
- package/ai/examples/blocks/Streaming1.tsx +353 -0
- package/ai/examples/blocks/Table1.tsx +303 -0
- package/ai/examples/blocks/Waitlist1.tsx +141 -0
- package/ai/examples/blocks/content/chat1content.ts +65 -0
- package/ai/examples/blocks/content/resources.ts +5 -0
- package/ai/examples/blocks/content/roadmap1content.ts +51 -0
- package/ai/examples/blocks/manifest.json +191 -0
- package/ai/examples/dashboard.tsx +150 -0
- package/ai/examples/marketing-hero.tsx +152 -0
- package/ai/examples/pricing.tsx +219 -0
- package/ai/examples/settings.tsx +140 -0
- package/ai/gotchas.json +85 -0
- package/ai/manifest.json +21 -0
- package/ai/rules.compact.md +73 -0
- package/ai/spec.json +2694 -2701
- package/ai/tasks/auth.json +23 -0
- package/ai/tasks/chat.json +28 -0
- package/ai/tasks/dashboard.json +39 -0
- package/ai/tasks/index.json +12 -0
- package/ai/tasks/marketing-hero.json +38 -0
- package/ai/tasks/pricing.json +42 -0
- package/ai/tasks/roadmap.json +22 -0
- package/ai/tasks/settings.json +34 -0
- package/dist/AGENTS.md +53 -0
- package/dist/README.md +27 -0
- package/dist/agent/once-ui-codegen.mdc +27 -0
- package/dist/ai/catalog.json +1650 -0
- package/dist/ai/catalog.seed.json +411 -0
- package/dist/ai/components/Accordion.json +136 -0
- package/dist/ai/components/AccordionGroup.json +128 -0
- package/dist/ai/components/Animation.json +146 -0
- package/dist/ai/components/Arrow.json +128 -0
- package/dist/ai/components/AutoScroll.json +130 -0
- package/dist/ai/components/Avatar.json +133 -0
- package/dist/ai/components/AvatarGroup.json +129 -0
- package/dist/ai/components/Background.json +131 -0
- package/dist/ai/components/Badge.json +132 -0
- package/dist/ai/components/Banner.json +122 -0
- package/dist/ai/components/BarChart.json +123 -0
- package/dist/ai/components/BlobFx.json +125 -0
- package/dist/ai/components/BlockQuote.json +132 -0
- package/dist/ai/components/Button.json +26 -0
- package/dist/ai/components/Card.json +129 -0
- package/dist/ai/components/Carousel.json +134 -0
- package/dist/ai/components/CelebrationFx.json +132 -0
- package/dist/ai/components/ChartHeader.json +130 -0
- package/dist/ai/components/ChartStatus.json +12 -0
- package/dist/ai/components/Checkbox.json +13 -0
- package/dist/ai/components/Chip.json +132 -0
- package/dist/ai/components/CodeBlock.json +122 -0
- package/dist/ai/components/ColorInput.json +13 -0
- package/dist/ai/components/Column.json +128 -0
- package/dist/ai/components/CompareImage.json +126 -0
- package/dist/ai/components/ContextMenu.json +22 -0
- package/dist/ai/components/CountFx.json +82 -0
- package/dist/ai/components/CountdownFx.json +11 -0
- package/dist/ai/components/Cursor.json +9 -0
- package/dist/ai/components/CursorCard.json +128 -0
- package/dist/ai/components/DataTooltip.json +15 -0
- package/dist/ai/components/DateInput.json +21 -0
- package/dist/ai/components/DatePicker.json +143 -0
- package/dist/ai/components/DateRangeInput.json +18 -0
- package/dist/ai/components/DateRangePicker.json +129 -0
- package/dist/ai/components/Dialog.json +134 -0
- package/dist/ai/components/DialogProvider.json +8 -0
- package/dist/ai/components/Dropdown.json +128 -0
- package/dist/ai/components/DropdownWrapper.json +28 -0
- package/dist/ai/components/EmojiPicker.json +129 -0
- package/dist/ai/components/EmojiPickerDropdown.json +13 -0
- package/dist/ai/components/Fade.json +130 -0
- package/dist/ai/components/FadingLettersFx.json +77 -0
- package/dist/ai/components/Feedback.json +132 -0
- package/dist/ai/components/Flex.json +125 -0
- package/dist/ai/components/FlipFx.json +133 -0
- package/dist/ai/components/GlitchFx.json +128 -0
- package/dist/ai/components/Grid.json +121 -0
- package/dist/ai/components/Heading.json +75 -0
- package/dist/ai/components/HeadingLink.json +127 -0
- package/dist/ai/components/HeadingNav.json +124 -0
- package/dist/ai/components/HoloFx.json +128 -0
- package/dist/ai/components/Hover.json +130 -0
- package/dist/ai/components/HoverCard.json +122 -0
- package/dist/ai/components/Icon.json +132 -0
- package/dist/ai/components/IconButton.json +22 -0
- package/dist/ai/components/InfiniteScroll.json +130 -0
- package/dist/ai/components/InlineCode.json +126 -0
- package/dist/ai/components/Input.json +24 -0
- package/dist/ai/components/InteractiveDetails.json +14 -0
- package/dist/ai/components/Kbar.json +10 -0
- package/dist/ai/components/Kbd.json +127 -0
- package/dist/ai/components/Legend.json +14 -0
- package/dist/ai/components/LetterFx.json +14 -0
- package/dist/ai/components/Line.json +125 -0
- package/dist/ai/components/LineBarChart.json +123 -0
- package/dist/ai/components/LineChart.json +123 -0
- package/dist/ai/components/LinearGauge.json +130 -0
- package/dist/ai/components/LinearGradient.json +15 -0
- package/dist/ai/components/List.json +127 -0
- package/dist/ai/components/ListItem.json +77 -0
- package/dist/ai/components/Logo.json +16 -0
- package/dist/ai/components/LogoCloud.json +124 -0
- package/dist/ai/components/Mask.json +131 -0
- package/dist/ai/components/MasonryGrid.json +132 -0
- package/dist/ai/components/MatrixFx.json +135 -0
- package/dist/ai/components/Media.json +142 -0
- package/dist/ai/components/MediaUpload.json +122 -0
- package/dist/ai/components/MegaMenu.json +125 -0
- package/dist/ai/components/MobileMegaMenu.json +125 -0
- package/dist/ai/components/Modal.json +12 -0
- package/dist/ai/components/NavIcon.json +127 -0
- package/dist/ai/components/NumberInput.json +16 -0
- package/dist/ai/components/OTPInput.json +13 -0
- package/dist/ai/components/OgCard.json +135 -0
- package/dist/ai/components/Option.json +137 -0
- package/dist/ai/components/Particle.json +135 -0
- package/dist/ai/components/PasswordInput.json +8 -0
- package/dist/ai/components/PieChart.json +123 -0
- package/dist/ai/components/ProgressBar.json +131 -0
- package/dist/ai/components/Pulse.json +129 -0
- package/dist/ai/components/RadialGauge.json +134 -0
- package/dist/ai/components/RadialGradient.json +16 -0
- package/dist/ai/components/RadioButton.json +17 -0
- package/dist/ai/components/RevealFx.json +131 -0
- package/dist/ai/components/Row.json +128 -0
- package/dist/ai/components/Schema.json +17 -0
- package/dist/ai/components/ScrollContainer.json +126 -0
- package/dist/ai/components/ScrollToTop.json +124 -0
- package/dist/ai/components/Scroller.json +128 -0
- package/dist/ai/components/SegmentedControl.json +132 -0
- package/dist/ai/components/Select.json +21 -0
- package/dist/ai/components/ShineFx.json +80 -0
- package/dist/ai/components/Skeleton.json +129 -0
- package/dist/ai/components/Slider.json +17 -0
- package/dist/ai/components/SmartLink.json +17 -0
- package/dist/ai/components/Spinner.json +127 -0
- package/dist/ai/components/SplitView.json +129 -0
- package/dist/ai/components/StatusIndicator.json +128 -0
- package/dist/ai/components/StyleOverlay.json +126 -0
- package/dist/ai/components/StylePanel.json +125 -0
- package/dist/ai/components/Swiper.json +130 -0
- package/dist/ai/components/Switch.json +20 -0
- package/dist/ai/components/Table.json +140 -0
- package/dist/ai/components/Tag.json +129 -0
- package/dist/ai/components/TagInput.json +12 -0
- package/dist/ai/components/Text.json +72 -0
- package/dist/ai/components/Textarea.json +24 -0
- package/dist/ai/components/ThemeSwitcher.json +122 -0
- package/dist/ai/components/TiltFx.json +126 -0
- package/dist/ai/components/Timeline.json +126 -0
- package/dist/ai/components/Toast.json +13 -0
- package/dist/ai/components/Toaster.json +14 -0
- package/dist/ai/components/ToggleButton.json +24 -0
- package/dist/ai/components/Tooltip.json +129 -0
- package/dist/ai/components/TypeFx.json +15 -0
- package/dist/ai/components/User.json +15 -0
- package/dist/ai/components/UserMenu.json +16 -0
- package/dist/ai/components/WeatherFx.json +133 -0
- package/dist/ai/eval-tasks.md +71 -0
- package/dist/ai/examples/blocks/manifest.json +191 -0
- package/dist/ai/gotchas.json +85 -0
- package/dist/ai/manifest.json +21 -0
- package/dist/ai/recipes.md +149 -0
- package/dist/ai/rules.compact.md +73 -0
- package/dist/ai/rules.md +217 -0
- package/dist/ai/spec.json +2695 -0
- package/dist/ai/tasks/auth.json +23 -0
- package/dist/ai/tasks/chat.json +28 -0
- package/dist/ai/tasks/dashboard.json +39 -0
- package/dist/ai/tasks/index.json +12 -0
- package/dist/ai/tasks/marketing-hero.json +38 -0
- package/dist/ai/tasks/pricing.json +42 -0
- package/dist/ai/tasks/roadmap.json +22 -0
- package/dist/ai/tasks/settings.json +34 -0
- package/dist/components/ContextMenu.d.ts +2 -2
- package/dist/components/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu.js +3 -3
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/ElementType.d.ts.map +1 -1
- package/dist/components/ElementType.js +6 -4
- package/dist/components/ElementType.js.map +1 -1
- package/dist/components/Media.d.ts.map +1 -1
- package/dist/components/Media.js +6 -3
- package/dist/components/Media.js.map +1 -1
- package/dist/components/MediaVideoPlayer.d.ts +12 -0
- package/dist/components/MediaVideoPlayer.d.ts.map +1 -0
- package/dist/components/MediaVideoPlayer.js +246 -0
- package/dist/components/MediaVideoPlayer.js.map +1 -0
- package/dist/components/MediaVideoPlayer.module.scss +90 -0
- package/dist/components/Table.d.ts +34 -6
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +114 -30
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Table.module.scss +174 -3
- package/dist/components/ThemeInit.d.ts.map +1 -1
- package/dist/components/ThemeInit.js +2 -1
- package/dist/components/ThemeInit.js.map +1 -1
- package/dist/components/Timeline.d.ts +1 -1
- package/dist/components/Timeline.d.ts.map +1 -1
- package/dist/components/Timeline.js +16 -52
- package/dist/components/Timeline.js.map +1 -1
- package/dist/data/emoji-data.json +0 -10
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +7 -2
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/code/CodeBlock.impl.d.ts.map +1 -1
- package/dist/modules/code/CodeBlock.impl.js +11 -5
- package/dist/modules/code/CodeBlock.impl.js.map +1 -1
- package/dist/modules/seo/Schema.d.ts.map +1 -1
- package/dist/modules/seo/Schema.js +3 -4
- package/dist/modules/seo/Schema.js.map +1 -1
- package/dist/package.json +33 -3
- package/dist/server/og-url-validation.d.ts +10 -0
- package/dist/server/og-url-validation.d.ts.map +1 -0
- package/dist/server/og-url-validation.js +234 -0
- package/dist/server/og-url-validation.js.map +1 -0
- package/dist/server/og-utils.d.ts +5 -2
- package/dist/server/og-utils.d.ts.map +1 -1
- package/dist/server/og-utils.js +39 -14
- package/dist/server/og-utils.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/safe-html.d.ts +19 -0
- package/dist/utils/safe-html.d.ts.map +1 -0
- package/dist/utils/safe-html.js +43 -0
- package/dist/utils/safe-html.js.map +1 -0
- package/package.json +159 -127
- package/scripts/copy-files.js +103 -0
- package/scripts/generate-ai-spec.js +464 -0
- package/scripts/generate-emoji-data.js +128 -0
- package/scripts/init-agent.js +156 -0
- package/scripts/validate-ai-code.js +149 -0
- package/LICENSE.md +0 -21
- package/next-env.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"og-utils.js","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"og-utils.js","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EAEpB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAgB7B,SAAS,kBAAkB,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AC;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes HTML special characters for safe insertion into HTML text nodes
|
|
3
|
+
* or attributes when content is not already sanitized HTML.
|
|
4
|
+
*/
|
|
5
|
+
export declare function escapeHtml(text: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Serializes a value for safe embedding inside HTML <script> tags.
|
|
8
|
+
* JSON.stringify escapes quotes and backslashes but not `<`, which allows
|
|
9
|
+
* `</script>` breakout when prop values are attacker-controlled.
|
|
10
|
+
*/
|
|
11
|
+
export declare function safeScriptJson(value: unknown): string;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a trimmed href when it is safe to use as a navigation target,
|
|
14
|
+
* otherwise `undefined`. Blocks `javascript:`, `data:`, and other non-allowlisted
|
|
15
|
+
* schemes (including variants with embedded whitespace/control characters).
|
|
16
|
+
* Scheme-less values (relative paths, `#hash`, `?query`) are allowed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sanitizeHref(href: string | null | undefined): string | undefined;
|
|
19
|
+
//# sourceMappingURL=safe-html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-html.d.ts","sourceRoot":"","sources":["../../src/utils/safe-html.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAErD;AAID;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAchF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes HTML special characters for safe insertion into HTML text nodes
|
|
3
|
+
* or attributes when content is not already sanitized HTML.
|
|
4
|
+
*/
|
|
5
|
+
export function escapeHtml(text) {
|
|
6
|
+
return text
|
|
7
|
+
.replace(/&/g, "&")
|
|
8
|
+
.replace(/</g, "<")
|
|
9
|
+
.replace(/>/g, ">")
|
|
10
|
+
.replace(/"/g, """)
|
|
11
|
+
.replace(/'/g, "'");
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serializes a value for safe embedding inside HTML <script> tags.
|
|
15
|
+
* JSON.stringify escapes quotes and backslashes but not `<`, which allows
|
|
16
|
+
* `</script>` breakout when prop values are attacker-controlled.
|
|
17
|
+
*/
|
|
18
|
+
export function safeScriptJson(value) {
|
|
19
|
+
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
20
|
+
}
|
|
21
|
+
const ALLOWED_HREF_SCHEMES = new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
22
|
+
/**
|
|
23
|
+
* Returns a trimmed href when it is safe to use as a navigation target,
|
|
24
|
+
* otherwise `undefined`. Blocks `javascript:`, `data:`, and other non-allowlisted
|
|
25
|
+
* schemes (including variants with embedded whitespace/control characters).
|
|
26
|
+
* Scheme-less values (relative paths, `#hash`, `?query`) are allowed.
|
|
27
|
+
*/
|
|
28
|
+
export function sanitizeHref(href) {
|
|
29
|
+
if (href == null)
|
|
30
|
+
return undefined;
|
|
31
|
+
const trimmed = href.trim();
|
|
32
|
+
if (!trimmed)
|
|
33
|
+
return undefined;
|
|
34
|
+
const forScheme = trimmed.replace(/[\u0000-\u001F\u007F\s]/g, "");
|
|
35
|
+
const schemeMatch = forScheme.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
36
|
+
if (schemeMatch) {
|
|
37
|
+
const scheme = schemeMatch[1].toLowerCase();
|
|
38
|
+
if (!ALLOWED_HREF_SCHEMES.has(scheme))
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return trimmed;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=safe-html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-html.js","sourceRoot":"","sources":["../../src/utils/safe-html.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI;SACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAA+B;IAC1D,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACnE,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5C,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,SAAS,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,127 +1,159 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@once-ui-system/core",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "Once UI for Next.js NPM package",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"once-ui",
|
|
7
|
-
"react",
|
|
8
|
-
"nextjs",
|
|
9
|
-
"scss",
|
|
10
|
-
"design system",
|
|
11
|
-
"design framework",
|
|
12
|
-
"nextjs design system"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
},
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"./
|
|
62
|
-
"import": "./dist/
|
|
63
|
-
"require": "./dist/
|
|
64
|
-
},
|
|
65
|
-
"./
|
|
66
|
-
"import": "./dist/
|
|
67
|
-
"require": "./dist/
|
|
68
|
-
},
|
|
69
|
-
"./
|
|
70
|
-
"import": "./dist/
|
|
71
|
-
"require": "./dist/
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@once-ui-system/core",
|
|
3
|
+
"version": "1.7.13",
|
|
4
|
+
"description": "Once UI for Next.js NPM package",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"once-ui",
|
|
7
|
+
"react",
|
|
8
|
+
"nextjs",
|
|
9
|
+
"scss",
|
|
10
|
+
"design system",
|
|
11
|
+
"design framework",
|
|
12
|
+
"nextjs design system",
|
|
13
|
+
"ai",
|
|
14
|
+
"agent",
|
|
15
|
+
"codegen"
|
|
16
|
+
],
|
|
17
|
+
"author": "Once UI",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/once-ui-system/core.git",
|
|
22
|
+
"directory": "packages/core"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/once-ui-system/core/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://docs.once-ui.com",
|
|
28
|
+
"onceUi": {
|
|
29
|
+
"harness": "./ai/manifest.json",
|
|
30
|
+
"bootstrap": [
|
|
31
|
+
"./ai/rules.compact.md",
|
|
32
|
+
"./ai/catalog.json"
|
|
33
|
+
],
|
|
34
|
+
"tasks": "./ai/tasks/index.json",
|
|
35
|
+
"validate": "./scripts/validate-ai-code.js",
|
|
36
|
+
"initAgent": "./scripts/init-agent.js",
|
|
37
|
+
"docs": "https://docs.once-ui.com/once-ui/ai-coding"
|
|
38
|
+
},
|
|
39
|
+
"bin": {
|
|
40
|
+
"once-ui-init-agent": "./scripts/init-agent.js",
|
|
41
|
+
"once-ui-validate-ai-code": "./scripts/validate-ai-code.js"
|
|
42
|
+
},
|
|
43
|
+
"main": "dist/index.js",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"import": "./dist/index.js",
|
|
47
|
+
"require": "./dist/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./components": {
|
|
50
|
+
"import": "./dist/components/index.js",
|
|
51
|
+
"require": "./dist/components/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./components/*": {
|
|
54
|
+
"import": "./dist/components/*.js",
|
|
55
|
+
"require": "./dist/components/*.js"
|
|
56
|
+
},
|
|
57
|
+
"./contexts": {
|
|
58
|
+
"import": "./dist/contexts/index.js",
|
|
59
|
+
"require": "./dist/contexts/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./modules": {
|
|
62
|
+
"import": "./dist/modules/index.js",
|
|
63
|
+
"require": "./dist/modules/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./icons": {
|
|
66
|
+
"import": "./dist/icons/index.js",
|
|
67
|
+
"require": "./dist/icons/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./types": {
|
|
70
|
+
"import": "./dist/types/index.js",
|
|
71
|
+
"require": "./dist/types/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./interfaces": {
|
|
74
|
+
"import": "./dist/interfaces/index.js",
|
|
75
|
+
"require": "./dist/interfaces/index.js"
|
|
76
|
+
},
|
|
77
|
+
"./css/styles.css": "./dist/css/styles.css",
|
|
78
|
+
"./css/tokens.css": "./dist/css/tokens.css",
|
|
79
|
+
"./utils": {
|
|
80
|
+
"import": "./dist/utils/index.js",
|
|
81
|
+
"require": "./dist/utils/index.js"
|
|
82
|
+
},
|
|
83
|
+
"./hooks": {
|
|
84
|
+
"import": "./dist/hooks/index.js",
|
|
85
|
+
"require": "./dist/hooks/index.js"
|
|
86
|
+
},
|
|
87
|
+
"./server": {
|
|
88
|
+
"import": "./dist/server/index.js",
|
|
89
|
+
"require": "./dist/server/index.js"
|
|
90
|
+
},
|
|
91
|
+
"./ai/manifest.json": "./ai/manifest.json",
|
|
92
|
+
"./ai/spec.json": "./ai/spec.json",
|
|
93
|
+
"./ai/catalog.json": "./ai/catalog.json",
|
|
94
|
+
"./ai/gotchas.json": "./ai/gotchas.json",
|
|
95
|
+
"./ai/rules.compact.md": "./ai/rules.compact.md",
|
|
96
|
+
"./ai/rules.md": "./ai/rules.md",
|
|
97
|
+
"./ai/recipes.md": "./ai/recipes.md",
|
|
98
|
+
"./ai/tasks/*": "./ai/tasks/*",
|
|
99
|
+
"./ai/components/*": "./ai/components/*",
|
|
100
|
+
"./ai/examples/*": "./ai/examples/*",
|
|
101
|
+
"./ai/examples/blocks/*": "./ai/examples/blocks/*",
|
|
102
|
+
"./AGENTS.md": "./AGENTS.md"
|
|
103
|
+
},
|
|
104
|
+
"scripts": {
|
|
105
|
+
"build": "pnpm clean && pnpm generate-emoji-data && pnpm generate-ai-spec && tsc --project tsconfig.build.json && pnpm copy-files && pnpm build:css",
|
|
106
|
+
"build:css": "sass src/styles/index.scss:dist/css/styles.css src/tokens/index.scss:dist/css/tokens.css --style=compressed",
|
|
107
|
+
"copy-files": "node scripts/copy-files.js",
|
|
108
|
+
"clean": "rimraf dist",
|
|
109
|
+
"prepare": "pnpm build",
|
|
110
|
+
"lint": "biome check .",
|
|
111
|
+
"format": "biome format --write .",
|
|
112
|
+
"test": "vitest run",
|
|
113
|
+
"test:watch": "vitest",
|
|
114
|
+
"typecheck": "tsc --noEmit",
|
|
115
|
+
"dev": "tsc --watch --preserveWatchOutput",
|
|
116
|
+
"prepack": "pnpm build",
|
|
117
|
+
"generate-emoji-data": "node scripts/generate-emoji-data.js",
|
|
118
|
+
"generate-ai-spec": "node scripts/generate-ai-spec.js",
|
|
119
|
+
"init-agent": "node scripts/init-agent.js",
|
|
120
|
+
"validate-ai-code": "node scripts/validate-ai-code.js"
|
|
121
|
+
},
|
|
122
|
+
"dependencies": {
|
|
123
|
+
"@floating-ui/react-dom": "^2.1.8",
|
|
124
|
+
"classnames": "^2.5.1",
|
|
125
|
+
"compressorjs": "^1.3.0",
|
|
126
|
+
"date-fns": "^4.1.0",
|
|
127
|
+
"prismjs": "^1.30.0",
|
|
128
|
+
"react-icons": "^5.6.0",
|
|
129
|
+
"recharts": "^3.8.1"
|
|
130
|
+
},
|
|
131
|
+
"peerDependencies": {
|
|
132
|
+
"next": ">=15.5",
|
|
133
|
+
"react": ">=18",
|
|
134
|
+
"react-dom": ">=18",
|
|
135
|
+
"sass": "^1.77.6",
|
|
136
|
+
"sharp": "^0.33.4 || ^0.34"
|
|
137
|
+
},
|
|
138
|
+
"peerDependenciesMeta": {
|
|
139
|
+
"sharp": { "optional": true }
|
|
140
|
+
},
|
|
141
|
+
"devDependencies": {
|
|
142
|
+
"@biomejs/biome": "2.4.13",
|
|
143
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
144
|
+
"@testing-library/react": "^16.3.0",
|
|
145
|
+
"@testing-library/user-event": "^14.6.1",
|
|
146
|
+
"@types/node": "20.17.23",
|
|
147
|
+
"@types/react": "19.2.5",
|
|
148
|
+
"@types/react-dom": "19.2.3",
|
|
149
|
+
"@vitest/ui": "^4.1.5",
|
|
150
|
+
"jsdom": "^27.0.0",
|
|
151
|
+
"rimraf": "^5.0.10",
|
|
152
|
+
"typescript": "5.8.2",
|
|
153
|
+
"vitest": "^4.1.5"
|
|
154
|
+
},
|
|
155
|
+
"overrides": {
|
|
156
|
+
"@types/react": "19.2.5",
|
|
157
|
+
"@types/react-dom": "19.2.3"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
// Function to copy directory recursively
|
|
5
|
+
function copyDir(src, dest) {
|
|
6
|
+
// Create destination directory if it doesn't exist
|
|
7
|
+
if (!fs.existsSync(dest)) {
|
|
8
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Read source directory
|
|
12
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
13
|
+
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
const srcPath = path.join(src, entry.name);
|
|
16
|
+
const destPath = path.join(dest, entry.name);
|
|
17
|
+
|
|
18
|
+
if (entry.isDirectory()) {
|
|
19
|
+
// Recursively copy directory
|
|
20
|
+
copyDir(srcPath, destPath);
|
|
21
|
+
} else {
|
|
22
|
+
// Copy file if it's not a TypeScript file (TS files are handled by tsc)
|
|
23
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
24
|
+
if (![".ts", ".tsx"].includes(ext)) {
|
|
25
|
+
fs.copyFileSync(srcPath, destPath);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Copy all style files and other assets
|
|
32
|
+
const srcDir = path.resolve(__dirname, "../src");
|
|
33
|
+
const destDir = path.resolve(__dirname, "../dist");
|
|
34
|
+
|
|
35
|
+
// Copy package.json with modifications
|
|
36
|
+
const packageJson = require("../package.json");
|
|
37
|
+
|
|
38
|
+
// Remove unnecessary fields for the published package
|
|
39
|
+
const fieldsToRemove = ["scripts", "devDependencies", "overrides"];
|
|
40
|
+
|
|
41
|
+
fieldsToRemove.forEach((field) => {
|
|
42
|
+
delete packageJson[field];
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Move some dependencies to peerDependencies
|
|
46
|
+
const peerDeps = {
|
|
47
|
+
react: packageJson.dependencies.react,
|
|
48
|
+
"react-dom": packageJson.dependencies["react-dom"],
|
|
49
|
+
next: packageJson.dependencies.next,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Add peer dependencies
|
|
53
|
+
packageJson.peerDependencies = {
|
|
54
|
+
...peerDeps,
|
|
55
|
+
react: ">=18.0.0",
|
|
56
|
+
"react-dom": ">=18.0.0",
|
|
57
|
+
next: ">=13.0.0",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Remove peer deps from dependencies
|
|
61
|
+
Object.keys(peerDeps).forEach((dep) => {
|
|
62
|
+
delete packageJson.dependencies[dep];
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Write the modified package.json to dist
|
|
66
|
+
fs.writeFileSync(path.resolve(destDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
67
|
+
|
|
68
|
+
// Copy README and AGENTS.md
|
|
69
|
+
if (fs.existsSync(path.resolve(__dirname, "../README.md"))) {
|
|
70
|
+
fs.copyFileSync(path.resolve(__dirname, "../README.md"), path.resolve(destDir, "README.md"));
|
|
71
|
+
}
|
|
72
|
+
if (fs.existsSync(path.resolve(__dirname, "../AGENTS.md"))) {
|
|
73
|
+
fs.copyFileSync(path.resolve(__dirname, "../AGENTS.md"), path.resolve(destDir, "AGENTS.md"));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Copy CLI scripts and agent templates for npm publish
|
|
77
|
+
const scriptsDir = path.resolve(destDir, "scripts");
|
|
78
|
+
fs.mkdirSync(scriptsDir, { recursive: true });
|
|
79
|
+
for (const script of ["init-agent.js", "validate-ai-code.js"]) {
|
|
80
|
+
fs.copyFileSync(
|
|
81
|
+
path.resolve(__dirname, script),
|
|
82
|
+
path.join(scriptsDir, script),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const agentSrc = path.resolve(__dirname, "../agent");
|
|
86
|
+
const agentDest = path.resolve(destDir, "agent");
|
|
87
|
+
if (fs.existsSync(agentSrc)) {
|
|
88
|
+
copyDir(agentSrc, agentDest);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Copy style files
|
|
92
|
+
console.log("Copying style files and other assets...");
|
|
93
|
+
copyDir(srcDir, destDir);
|
|
94
|
+
|
|
95
|
+
// Copy AI harness artifacts for npm publish
|
|
96
|
+
const aiDir = path.resolve(__dirname, "../ai");
|
|
97
|
+
const aiDest = path.resolve(destDir, "ai");
|
|
98
|
+
if (fs.existsSync(aiDir)) {
|
|
99
|
+
console.log("Copying AI artifacts...");
|
|
100
|
+
copyDir(aiDir, aiDest);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.log("Files copied successfully!");
|