@cwa/nuxt-edge 0.0.0-29854751.0f3ff4e → 0.0.0-29857698.a2a75db

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.
@@ -23,7 +23,7 @@
23
23
  <template #item="{ data }">
24
24
  <div class="cwa:flex cwa:border-b cwa:border-b-stone-700 cwa:py-6 cwa:gap-x-4 cwa:items-center">
25
25
  <div class="cwa:grow cwa:flex cwa:flex-col cwa:gap-y-1">
26
- <span class="cwa:text-xl cwa:text-pretty">{{ data.title }}<span :class="['cwa:inline-block', 'cwa:align-middle', 'cwa:-translate-y-0.5', 'cwa:ml-3', 'cwa:outline', 'cwa:outline-1', 'cwa:outline-offset-2', 'cwa:w-2', 'cwa:h-2', 'cwa:shrink-0', 'cwa:rounded-full', data.route ? ['cwa:outline-green', 'cwa:bg-green'] : ['cwa:outline-orange', 'cwa:bg-orange']]" /></span>
26
+ <span class="cwa:text-xl cwa:text-pretty">{{ data.title }}<span :class="['cwa:inline-block', 'cwa:align-middle', 'cwa:-translate-y-0.5', 'cwa:ml-3', 'cwa:outline', 'cwa:outline-1', 'cwa:outline-offset-2', 'cwa:w-2', 'cwa:h-2', 'cwa:shrink-0', 'cwa:rounded-full', data.route || data.isReachableWithoutRoute ? ['cwa:outline-green', 'cwa:bg-green'] : ['cwa:outline-orange', 'cwa:bg-orange']]" /></span>
27
27
  <span class="cwa:text-stone-400">{{ pageDataById[data.page]?.reference || data.page }}</span>
28
28
  </div>
29
29
  <div class="cwa:flex cwa:gap-x-2">
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.6.0"
6
6
  },
7
- "version": "2.0.0-alpha.6",
7
+ "version": "2.0.0-alpha.8",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
@@ -109,6 +109,10 @@
109
109
  />
110
110
  </div>
111
111
  </div>
112
+ <ModalReachableToggle
113
+ v-model="localResourceData.isReachableWithoutRoute"
114
+ :has-route="!!resource?.route"
115
+ />
112
116
  <div class="cwa:flex cwa:justify-end cwa:pt-2 cwa:gap-x-2">
113
117
  <div>
114
118
  <CwaUiFormButton
@@ -187,6 +191,7 @@ import { componentNames } from "#components";
187
191
  import { useCwa } from "#imports";
188
192
  import ModalSelect from "#cwa/templates/components/core/admin/form/ModalSelect.vue";
189
193
  import ModalRadioTabs from "#cwa/templates/components/core/admin/form/ModalRadioTabs.vue";
194
+ import ModalReachableToggle from "#cwa/templates/components/core/admin/form/ModalReachableToggle.vue";
190
195
  import PageTypeSelect from "#cwa/templates/components/core/admin/form/PageTypeSelect.vue";
191
196
  import RoutesTab from "#cwa/templates/components/core/admin/RoutesTab.vue";
192
197
  const emit = defineEmits(["close", "reload"]);
@@ -4,7 +4,7 @@
4
4
  v-model="localResourceData.title"
5
5
  title-placeholder="No Title"
6
6
  :is-loading="isLoading"
7
- :border-color-class="resource?.route ? 'cwa:border-b-green' : 'cwa:border-b-orange'"
7
+ :border-color-class="resource?.route || resource?.isReachableWithoutRoute ? 'cwa:border-b-green' : 'cwa:border-b-orange'"
8
8
  @close="$emit('close')"
9
9
  @save="saveTitle"
10
10
  >
@@ -120,6 +120,10 @@
120
120
  />
121
121
  </template>
122
122
  </div>
123
+ <ModalReachableToggle
124
+ v-model="localResourceData.isReachableWithoutRoute"
125
+ :has-route="!!resource?.route"
126
+ />
123
127
  <div class="cwa:flex cwa:justify-end cwa:pt-2 cwa:gap-x-2">
124
128
  <div>
125
129
  <CwaUiFormButton
@@ -198,6 +202,7 @@ import ModalInput from "#cwa/templates/components/core/admin/form/ModalInput.vue
198
202
  import { useItemPage } from "#cwa-layer/_composables/useItemPage";
199
203
  import ModalSelect from "#cwa/templates/components/core/admin/form/ModalSelect.vue";
200
204
  import ModalRadioTabs from "#cwa/templates/components/core/admin/form/ModalRadioTabs.vue";
205
+ import ModalReachableToggle from "#cwa/templates/components/core/admin/form/ModalReachableToggle.vue";
201
206
  import RoutesTab from "#cwa/templates/components/core/admin/RoutesTab.vue";
202
207
  import { useDynamicPageLoader } from "#cwa-layer/_composables/useDynamicPageLoader";
203
208
  import { useDataList } from "#cwa-layer/_composables/useDataList";
@@ -161,6 +161,10 @@
161
161
  </template>
162
162
  </div>
163
163
  </template>
164
+ <ModalReachableToggle
165
+ v-model="localResourceData.isReachableWithoutRoute"
166
+ :has-route="!!resource?.route"
167
+ />
164
168
  <div class="cwa:flex cwa:justify-end cwa:pt-2 cwa:gap-x-2">
165
169
  <div>
166
170
  <CwaUiFormButton
@@ -236,6 +240,7 @@ import ModalInfo from "#cwa/templates/components/core/admin/form/ModalInfo.vue";
236
240
  import ModalInput from "#cwa/templates/components/core/admin/form/ModalInput.vue";
237
241
  import ModalSelect from "#cwa/templates/components/core/admin/form/ModalSelect.vue";
238
242
  import ModalRadioTabs from "#cwa/templates/components/core/admin/form/ModalRadioTabs.vue";
243
+ import ModalReachableToggle from "#cwa/templates/components/core/admin/form/ModalReachableToggle.vue";
239
244
  import PageTypeSelect from "#cwa/templates/components/core/admin/form/PageTypeSelect.vue";
240
245
  import RoutesTab from "#cwa/templates/components/core/admin/RoutesTab.vue";
241
246
  import { CwaResourceTypes, getResourceTypeFromIri } from "#cwa/resources/resource-utils";
@@ -341,7 +346,7 @@ const borderColorClass = computed(() => {
341
346
  if (isDisplayingPage.value) {
342
347
  return localResourceData.value?.isTemplate ? "cwa:border-b-yellow" : "cwa:border-b-blue-600";
343
348
  }
344
- return resource.value?.route ? "cwa:border-b-green" : "cwa:border-b-orange";
349
+ return resource.value?.route || resource.value?.isReachableWithoutRoute ? "cwa:border-b-green" : "cwa:border-b-orange";
345
350
  });
346
351
  function saveResource(close = false) {
347
352
  if (localResourceData.value) {
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ modelValue: boolean | undefined | null;
3
+ hasRoute: boolean;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: boolean) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,19 @@
1
+ <script setup>
2
+ const { modelValue, hasRoute } = defineProps({
3
+ modelValue: { type: [Boolean, null], required: true, skipCheck: true },
4
+ hasRoute: { type: Boolean, required: true }
5
+ });
6
+ const emit = defineEmits(["update:modelValue"]);
7
+ </script>
8
+
9
+ <template>
10
+ <div class="cwa:flex cwa:flex-col cwa:gap-y-1 cwa:px-1">
11
+ <CwaUiFormToggle
12
+ :model-value="modelValue"
13
+ :disabled="hasRoute"
14
+ label="Public without a route"
15
+ @update:model-value="emit('update:modelValue', $event)"
16
+ />
17
+ <span class="cwa:text-xs cwa:text-stone-400">{{ hasRoute ? "Has no effect while this page has a route." : "Also needs any parent page to be live." }}</span>
18
+ </div>
19
+ </template>
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ modelValue: boolean | undefined | null;
3
+ hasRoute: boolean;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: boolean) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  label: string;
3
3
  modelValue: boolean | undefined | null;
4
+ disabled?: boolean;
4
5
  };
5
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
7
  "update:modelValue": (...args: any[]) => void;
@@ -2,9 +2,10 @@
2
2
  import { Switch, SwitchGroup, SwitchLabel } from "@headlessui/vue";
3
3
  import { computed } from "vue";
4
4
  const emit = defineEmits(["update:modelValue"]);
5
- const { modelValue } = defineProps({
5
+ const { modelValue, disabled = false } = defineProps({
6
6
  label: { type: String, required: true },
7
- modelValue: { type: [Boolean, null], required: true, skipCheck: true }
7
+ modelValue: { type: [Boolean, null], required: true, skipCheck: true },
8
+ disabled: { type: Boolean, required: false }
8
9
  });
9
10
  const valueAsBoolean = computed({
10
11
  get() {
@@ -26,9 +27,11 @@ function handleSwitchInput(newValue) {
26
27
  >
27
28
  <Switch
28
29
  :model-value="valueAsBoolean"
30
+ :disabled="disabled"
29
31
  :class="[
30
32
  modelValue ? 'cwa:bg-indigo-600' : 'cwa:bg-gray-200',
31
- 'cwa:relative cwa:inline-flex cwa:h-6 cwa:w-11 cwa:shrink-0 cwa:cursor-pointer cwa:border-2 cwa:border-transparent cwa:transition-colors cwa:duration-200 cwa:ease-in-out cwa:rounded-full'
33
+ disabled ? 'cwa:opacity-50 cwa:cursor-not-allowed' : 'cwa:cursor-pointer',
34
+ 'cwa:relative cwa:inline-flex cwa:h-6 cwa:w-11 cwa:shrink-0 cwa:border-2 cwa:border-transparent cwa:transition-colors cwa:duration-200 cwa:ease-in-out cwa:rounded-full'
32
35
  ]"
33
36
  @update:model-value="handleSwitchInput"
34
37
  >
@@ -40,7 +43,8 @@ function handleSwitchInput(newValue) {
40
43
 
41
44
  <SwitchLabel
42
45
  as="span"
43
- class="cwa:ml-3 cwa:text-sm cwa:cursor-pointer"
46
+ class="cwa:ml-3 cwa:text-sm"
47
+ :class="disabled ? 'cwa:opacity-50 cwa:cursor-not-allowed' : 'cwa:cursor-pointer'"
44
48
  >
45
49
  <span class="cwa:font-medium">{{ label }}</span>
46
50
  </SwitchLabel>
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  label: string;
3
3
  modelValue: boolean | undefined | null;
4
+ disabled?: boolean;
4
5
  };
5
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
7
  "update:modelValue": (...args: any[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cwa/nuxt-edge",
3
- "version": "0.0.0-29854751.0f3ff4e",
3
+ "version": "0.0.0-29857698.a2a75db",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Components Web Apps Nuxt Module. UI for creating component-driven web apps with the API Components Bundle",