@dynect/base 0.3.0 → 0.5.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/package.json +1 -1
- package/src/module.ts +16 -6
- package/src/runtime/components/base/event-calendar/composables/useResilientErrorHandling.ts +3 -0
- package/src/runtime/components/dynect/SwitchColor.vue +1 -0
- package/src/runtime/components/dynect/SwitchLanguage.vue +1 -0
- package/src/runtime/components/dynect/Telephone.vue +1 -0
- package/src/runtime/components/ui/sidebar/SidebarProvider.vue +1 -0
package/package.json
CHANGED
package/src/module.ts
CHANGED
|
@@ -69,15 +69,25 @@ export default defineNuxtModule<DynectBaseOptions>({
|
|
|
69
69
|
const isStandalone = existsSync(join(runtimeComponentsDir, 'dynect'));
|
|
70
70
|
const componentsBase = isStandalone ? runtimeComponentsDir : monorepoComponentsDir;
|
|
71
71
|
|
|
72
|
-
// ──
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
// ── Path aliases for intra-package imports ───────────────────────────────
|
|
73
|
+
// Dynect components use @/components/ui/* and @/lib/utils.
|
|
74
|
+
// In standalone mode, @/ resolves to the consuming app's srcDir which won't
|
|
75
|
+
// have those paths — redirect them to the bundled runtime copies.
|
|
76
|
+
|
|
77
|
+
const srcDir = nuxt.options.srcDir;
|
|
78
|
+
|
|
79
|
+
// @/lib/utils → runtime/lib/utils (when not present in consuming app)
|
|
80
|
+
if (!existsSync(join(srcDir, 'lib', 'utils.ts'))) {
|
|
81
|
+
nuxt.options.alias[join(srcDir, 'lib', 'utils')] =
|
|
78
82
|
resolver.resolve('./runtime/lib/utils');
|
|
79
83
|
}
|
|
80
84
|
|
|
85
|
+
// @/components/ui/* → runtime/components/ui/* (when not present in consuming app)
|
|
86
|
+
if (isStandalone && !existsSync(join(srcDir, 'components', 'ui'))) {
|
|
87
|
+
nuxt.options.alias[join(srcDir, 'components', 'ui')] =
|
|
88
|
+
join(runtimeComponentsDir, 'ui');
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
// ── Install required Nuxt modules ────────────────────────────────────────
|
|
82
92
|
if (options.shadcn !== false) {
|
|
83
93
|
await installModule('shadcn-nuxt', {
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
<script setup lang="ts">
|
|
110
110
|
import { parsePhoneNumberFromString, type CountryCode, type NumberFormat } from 'libphonenumber-js/max';
|
|
111
111
|
import { cva } from 'class-variance-authority';
|
|
112
|
+
import { useState, useId } from 'nuxt/app';
|
|
112
113
|
import { cn, inputSizeClasses } from '@/lib/utils';
|
|
113
114
|
|
|
114
115
|
type InputSize = 'sm' | 'base' | 'lg' | 'xl';
|
|
@@ -3,6 +3,7 @@ import type { HTMLAttributes, Ref } from 'vue';
|
|
|
3
3
|
import { useEventListener, useMediaQuery, useVModel } from '@vueuse/core';
|
|
4
4
|
import { TooltipProvider } from 'reka-ui';
|
|
5
5
|
import { computed, ref } from 'vue';
|
|
6
|
+
import { useCookie } from 'nuxt/app';
|
|
6
7
|
import { cn } from '@/lib/utils';
|
|
7
8
|
import { provideSidebarContext, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON } from './utils';
|
|
8
9
|
|