@raclettejs/workbench 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +1 -0
  2. package/config/compositions.js +282 -0
  3. package/config/interactionLinks.js +164 -0
  4. package/i18n/de-DE.json +245 -0
  5. package/i18n/en-EU.json +245 -0
  6. package/i18n/sk-SK.json +245 -0
  7. package/package.json +63 -0
  8. package/packages.json +33 -0
  9. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionConfiguration.vue +140 -0
  10. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionIntegration.vue +3 -0
  11. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionWidgetsLayout.vue +129 -0
  12. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetContextMenu.vue +53 -0
  13. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetIcon.vue +99 -0
  14. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetList.vue +122 -0
  15. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetRenderer.vue +65 -0
  16. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetSettings.vue +96 -0
  17. package/plugins/pacifico__compositions/frontend/widgets/CompositionCreateWidget.vue +51 -0
  18. package/plugins/pacifico__compositions/frontend/widgets/CompositionEditWidget.vue +66 -0
  19. package/plugins/pacifico__compositions/frontend/widgets/CompositionListWidget.vue +132 -0
  20. package/plugins/pacifico__compositions/raclette.plugin.ts +8 -0
  21. package/plugins/pacifico__core/backend/index.ts +25 -0
  22. package/plugins/pacifico__core/backend/routes.ts +220 -0
  23. package/plugins/pacifico__core/raclette.plugin.ts +9 -0
  24. package/plugins/pacifico__interactionLinks/frontend/components/InteractionLinkConfiguration.vue +145 -0
  25. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkCreateWidget.vue +48 -0
  26. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkEditWidget.vue +66 -0
  27. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkListWidget.vue +126 -0
  28. package/plugins/pacifico__interactionLinks/raclette.plugin.ts +8 -0
  29. package/plugins/pacifico__plugins/frontend/index.ts +42 -0
  30. package/plugins/pacifico__plugins/frontend/widgets/PluginDetailWidget.vue +26 -0
  31. package/plugins/pacifico__plugins/frontend/widgets/PluginListWidget.vue +59 -0
  32. package/plugins/pacifico__plugins/raclette.plugin.ts +8 -0
  33. package/plugins/pacifico__tags/frontend/components/TagConfiguration.vue +99 -0
  34. package/plugins/pacifico__tags/frontend/widgets/TagCreateWidget.vue +43 -0
  35. package/plugins/pacifico__tags/frontend/widgets/TagEditWidget.vue +64 -0
  36. package/plugins/pacifico__tags/frontend/widgets/TagListWidget.vue +71 -0
  37. package/plugins/pacifico__tags/raclette.plugin.ts +8 -0
  38. package/plugins/pacifico__users/frontend/components/UserConfiguration.vue +110 -0
  39. package/plugins/pacifico__users/frontend/widgets/UserCreateWidget.vue +48 -0
  40. package/plugins/pacifico__users/frontend/widgets/UserEditWidget.vue +64 -0
  41. package/plugins/pacifico__users/frontend/widgets/UserListWidget.vue +86 -0
  42. package/plugins/pacifico__users/raclette.plugin.ts +8 -0
  43. package/raclette.config.js +150 -0
  44. package/services/frontend/.DS_Store +0 -0
  45. package/services/frontend/public/favicon.png +0 -0
  46. package/services/frontend/public/home-icon.png +0 -0
  47. package/services/frontend/public/logo.png +0 -0
  48. package/services/frontend/src/app/.DS_Store +0 -0
  49. package/services/frontend/src/app/components/BaseDataTable.vue +284 -0
  50. package/services/frontend/src/app/components/dynamicForm/DynamicForm.vue +207 -0
  51. package/services/frontend/src/app/components/dynamicForm/DynamicFormTypes.ts +63 -0
  52. package/services/frontend/src/app/components/dynamicForm/DynamicInput.vue +344 -0
  53. package/services/frontend/src/app/components/dynamicForm/TextDivider.vue +13 -0
  54. package/services/frontend/src/app/components/dynamicForm/testing/DynamicFormInputTesting.vue +477 -0
  55. package/services/frontend/src/app/components/dynamicForm/typedInputs/CheckboxInput.vue +16 -0
  56. package/services/frontend/src/app/components/dynamicForm/typedInputs/ColorInput.vue +52 -0
  57. package/services/frontend/src/app/components/dynamicForm/typedInputs/CompositionInput.vue +32 -0
  58. package/services/frontend/src/app/components/dynamicForm/typedInputs/IconInput.vue +40 -0
  59. package/services/frontend/src/app/components/dynamicForm/typedInputs/ListInput.vue +51 -0
  60. package/services/frontend/src/app/components/dynamicForm/typedInputs/LocalizedInput.vue +51 -0
  61. package/services/frontend/src/app/components/dynamicForm/typedInputs/PasswordInput.vue +23 -0
  62. package/services/frontend/src/app/components/dynamicForm/typedInputs/RecordInput.vue +91 -0
  63. package/services/frontend/src/app/components/dynamicForm/typedInputs/SwitchInput.vue +17 -0
  64. package/services/frontend/src/app/components/dynamicForm/typedInputs/TagsInput.vue +58 -0
  65. package/services/frontend/src/app/components/dynamicForm/typedInputs/TriggerInput.vue +159 -0
  66. package/services/frontend/src/app/components/dynamicForm/typedInputs/UserInput.vue +63 -0
  67. package/services/frontend/src/app/components/dynamicForm/typedInputs/mdi-icons.ts +7002 -0
  68. package/services/frontend/src/app/components/dynamicForm/validators.ts +19 -0
  69. package/services/frontend/src/app/components/stepNavigator/StepNavigator.vue +331 -0
  70. package/services/frontend/src/app/components/stepNavigator/StepNavigatorTypes.ts +12 -0
  71. package/services/frontend/src/app/composables/useUserHelper.ts +254 -0
  72. package/services/frontend/src/app/composables/useVantaFog.ts +37 -0
  73. package/services/frontend/src/app/composables/useWorkbenchPlugins.ts +44 -0
  74. package/services/frontend/src/orchestrator/.DS_Store +0 -0
  75. package/services/frontend/src/orchestrator/LoginApp.vue +62 -0
  76. package/services/frontend/src/orchestrator/WelcomeScreen.vue +39 -0
  77. package/services/frontend/src/orchestrator/assets/styles/themes/dark.ts +39 -0
  78. package/services/frontend/src/orchestrator/assets/styles/themes/highContrast.ts +39 -0
  79. package/services/frontend/src/orchestrator/assets/styles/themes/light.ts +39 -0
  80. package/services/frontend/src/orchestrator/components/InitProjectScreen.vue +298 -0
  81. package/services/frontend/src/orchestrator/components/LoginScreen.vue +73 -0
  82. package/services/frontend/src/orchestrator/components/RacletteAdCorner.vue +313 -0
  83. package/services/frontend/src/orchestrator/components/layout/AppButton.vue +109 -0
  84. package/services/frontend/src/orchestrator/components/layout/AppHeadline.vue +46 -0
  85. package/services/frontend/src/orchestrator/components/layout/AppLabelledInput.vue +94 -0
  86. package/services/frontend/src/orchestrator/components/layout/AppModal.vue +28 -0
  87. package/services/frontend/src/orchestrator/components/layout/SvgButtonArrow.vue +14 -0
  88. package/services/frontend/src/orchestrator/composables/useWelcomeScreen.ts +19 -0
  89. package/yarn.lock +3435 -0
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="tw:grid tw:gap-2">
3
+ <v-text-field
4
+ :id="inputId"
5
+ v-bind="$attrs"
6
+ v-model="modelValue.default"
7
+ variant="outlined"
8
+ append-inner-icon="mdi-web"
9
+ @click:append-inner="showLocalizedInputs = !showLocalizedInputs"
10
+ :label="title"
11
+ />
12
+
13
+ <template v-if="showLocalizedInputs" v-for="(_, key) in modelValue">
14
+ <v-text-field
15
+ v-if="key !== 'default'"
16
+ v-bind="$attrs"
17
+ :key="key"
18
+ :id="`${inputId}-${key}`"
19
+ v-model="modelValue[key]"
20
+ variant="outlined"
21
+ hide-details
22
+ >
23
+ <template #prepend-inner>
24
+ <v-chip text-color="black" size="small" class="ma-0 mr-2" label>
25
+ {{ key.toUpperCase() }}
26
+ </v-chip>
27
+ </template>
28
+ </v-text-field>
29
+ </template>
30
+ </div>
31
+ </template>
32
+
33
+ <script setup lang="ts">
34
+ import { ref } from "vue"
35
+
36
+ defineOptions({
37
+ inheritAttrs: false,
38
+ })
39
+
40
+ defineProps<{
41
+ inputId: string
42
+ title?: string
43
+ }>()
44
+
45
+ const modelValue = defineModel<Record<string, string>>({
46
+ required: true,
47
+ default: { default: "", de: "", en: "" },
48
+ })
49
+
50
+ const showLocalizedInputs = ref(false)
51
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <v-text-field
3
+ :id="inputId"
4
+ v-model="modelValue"
5
+ :type="showPasswordText ? 'text' : 'password'"
6
+ variant="outlined"
7
+ hide-details
8
+ :append-inner-icon="showPasswordText ? 'mdi-eye' : 'mdi-eye-off'"
9
+ @click:append-inner="showPasswordText = !showPasswordText"
10
+ />
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { ref } from "vue"
15
+
16
+ defineProps<{
17
+ inputId?: string
18
+ }>()
19
+
20
+ const modelValue = defineModel<string>({ required: true })
21
+
22
+ const showPasswordText = ref(false)
23
+ </script>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="tw:grid tw:gap-2">
3
+ <div
4
+ v-for="(entry, index) in entries"
5
+ :key="index"
6
+ class="tw:grid tw:grid-cols-12 tw:gap-2"
7
+ >
8
+ <v-text-field
9
+ :model-value="entry.key"
10
+ @update:model-value="entry.key = $event"
11
+ @blur="emitEntries"
12
+ label="Key"
13
+ class="tw:col-span-5"
14
+ hide-details
15
+ variant="outlined"
16
+ />
17
+
18
+ <v-text-field
19
+ :model-value="entry.value"
20
+ @update:model-value="entry.value = $event"
21
+ @blur="emitEntries"
22
+ label="Value"
23
+ class="tw:col-span-6"
24
+ hide-details
25
+ variant="outlined"
26
+ />
27
+ <v-btn
28
+ icon="mdi-minus"
29
+ color="red"
30
+ class="tw:col-span-1"
31
+ @click="remove(index)"
32
+ />
33
+ </div>
34
+
35
+ <v-btn
36
+ icon="mdi-plus"
37
+ color="green"
38
+ @click="add"
39
+ :disabled="hasEmptyKeyEntry"
40
+ />
41
+ </div>
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ import { computed, ref, watch } from "vue"
46
+ import { equals } from "ramda"
47
+
48
+ const modelValue = defineModel<Record<string, string>>({ required: true })
49
+
50
+ // internal list of the record
51
+ const entries = ref<{ key: string; value: string }[]>([])
52
+
53
+ const hasEmptyKeyEntry = computed(() =>
54
+ entries.value.some((entry) => entry.key.trim() === ""),
55
+ )
56
+
57
+ const emitEntries = () => {
58
+ const obj: Record<string, string> = {}
59
+ for (const entry of entries.value) {
60
+ if (entry.key) {
61
+ obj[entry.key] = entry.value
62
+ }
63
+ }
64
+ modelValue.value = obj
65
+ }
66
+
67
+ const add = () => {
68
+ entries.value.push({ key: "", value: "" })
69
+ }
70
+
71
+ const remove = (index: number) => {
72
+ entries.value.splice(index, 1)
73
+ }
74
+
75
+ // synchronize local clone of the modelValue
76
+ watch(
77
+ () => modelValue.value,
78
+ (newVal, oldVal) => {
79
+ if (!equals(newVal, oldVal)) {
80
+ entries.value = Object.entries(newVal ?? {}).map(([key, value]) => ({
81
+ key,
82
+ value,
83
+ }))
84
+ }
85
+ if (entries.value.length === 0) {
86
+ entries.value = [{ key: "", value: "" }]
87
+ }
88
+ },
89
+ { immediate: true },
90
+ )
91
+ </script>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <v-switch
3
+ v-model="modelValue"
4
+ :id="inputId"
5
+ variant="outlined"
6
+ hide-details
7
+ color="primary"
8
+ />
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ defineProps<{
13
+ inputId: string
14
+ }>()
15
+
16
+ const modelValue = defineModel<boolean>({ default: false })
17
+ </script>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <v-autocomplete
3
+ v-model="modelValue"
4
+ v-bind="$attrs"
5
+ :id="inputId"
6
+ :items="tags"
7
+ :loading="query.loading"
8
+ :disabled="query.loading"
9
+ item-value="_id"
10
+ item-title="title"
11
+ multiple
12
+ variant="outlined"
13
+ chips
14
+ >
15
+ <template #chip="{ item }">
16
+ <v-chip
17
+ :color="item.raw.color"
18
+ label
19
+ variant="outlined"
20
+ closable
21
+ @click:close="removeItem(item.value)"
22
+ >
23
+ {{ item.title }}
24
+ </v-chip>
25
+ </template>
26
+
27
+ <template #item="{ props, item }">
28
+ <v-list-item v-bind="props" title="">
29
+ <v-chip :color="item.raw.color" label variant="outlined" size="small">
30
+ {{ item.title }}
31
+ </v-chip>
32
+ </v-list-item>
33
+ </template>
34
+ </v-autocomplete>
35
+ </template>
36
+
37
+ <script setup lang="ts">
38
+ import { usePluginApi } from "@raclettejs/core/orchestrator/composables"
39
+ import { computed } from "vue"
40
+
41
+ defineProps<{
42
+ inputId: string
43
+ }>()
44
+
45
+ const modelValue = defineModel<string[]>({ required: true })
46
+
47
+ const { $data } = usePluginApi("raclette__core")
48
+
49
+ const { data, query } = $data.tag.getAll({
50
+ options: { immediate: true },
51
+ })
52
+
53
+ const tags = computed(() => Object.values(data.value || {}))
54
+
55
+ const removeItem = (id: string) => {
56
+ modelValue.value = modelValue.value.filter((val) => val !== id)
57
+ }
58
+ </script>
@@ -0,0 +1,159 @@
1
+ <template>
2
+ <div class="tw:grid tw:gap-2">
3
+ <!-- existing triggers -->
4
+ <div
5
+ class="tw:py-2 tw:border-solid tw:rounded"
6
+ v-for="(trigger, index) in modelValue"
7
+ :key="index"
8
+ >
9
+ <v-select
10
+ v-model="trigger.type"
11
+ v-bind="$attrs"
12
+ :items="triggerTypes"
13
+ variant="outlined"
14
+ hide-details
15
+ class="tw:flex-1"
16
+ append-icon="mdi-minus"
17
+ @update:model-value="updateTriggerType($event, index)"
18
+ @click:append="modelValue.splice(index, 1)"
19
+ :label="$t('workbench.dynamicInputs.triggers.triggerTypeLabel')"
20
+ :disabled="true"
21
+ />
22
+
23
+ <div class="tw:grid tw:gap-2 tw:p-2">
24
+ <template
25
+ v-if="
26
+ ['top-navigation', 'page-navigation', 'user-menu'].includes(
27
+ trigger.type,
28
+ )
29
+ "
30
+ >
31
+ <IconInput v-model="trigger.settings.icon" v-bind="$attrs" />
32
+
33
+ <LocalizedInput
34
+ v-model="trigger.settings.title"
35
+ v-bind="$attrs"
36
+ :input-id="`title-${index}`"
37
+ :title="$t('workbench.dynamicInputs.triggers.titleLabel')"
38
+ />
39
+
40
+ <v-number-input
41
+ v-model="trigger.settings.sortOrder"
42
+ v-bind="$attrs"
43
+ variant="outlined"
44
+ control-variant="default"
45
+ :label="$t('workbench.dynamicInputs.triggers.sortOrderLabel')"
46
+ hide-details
47
+ :min="0"
48
+ />
49
+ <v-select
50
+ v-if="trigger.type === 'page-navigation'"
51
+ v-bind="$attrs"
52
+ v-model="trigger.settings.navigationBarType"
53
+ :items="pageNavigationTypes"
54
+ variant="outlined"
55
+ hide-details
56
+ class="tw:flex-1"
57
+ :label="
58
+ $t('workbench.dynamicInputs.triggers.navigationBarTypeLabel')
59
+ "
60
+ />
61
+ </template>
62
+
63
+ <template v-else-if="trigger.type === 'shortcut'">
64
+ <ListInput v-model="trigger.settings.shortcuts" v-bind="$attrs" />
65
+ </template>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- new trigger -->
70
+ <v-select
71
+ v-model="virtualTrigger.type"
72
+ v-bind="$attrs"
73
+ :items="triggerTypes"
74
+ variant="outlined"
75
+ hide-details
76
+ class="tw:flex-1"
77
+ append-icon="mdi-plus"
78
+ :label="$t('workbench.dynamicInputs.triggers.newTriggerLabel')"
79
+ @update:model-value="addVirtualTrigger"
80
+ @click:append="addVirtualTrigger"
81
+ @blur="addVirtualTrigger"
82
+ />
83
+ </div>
84
+ </template>
85
+
86
+ <script setup lang="ts">
87
+ import { ref } from "vue"
88
+ import type { Trigger } from "@raclettejs/core"
89
+ import LocalizedInput from "./LocalizedInput.vue"
90
+ import IconInput from "./IconInput.vue"
91
+ import ListInput from "./ListInput.vue"
92
+
93
+ defineOptions({
94
+ inheritAttrs: false,
95
+ })
96
+
97
+ const modelValue = defineModel<Trigger[]>({ required: true })
98
+
99
+ // TODO readd "top-navigation", "shortcut" once they are implemented
100
+ const triggerTypes = ["page-navigation", "user-menu"] as const
101
+ const pageNavigationTypes = ["footerItem", "navItem"] as const
102
+ const virtualTrigger = ref<Trigger>({
103
+ type: "",
104
+ settings: undefined,
105
+ })
106
+
107
+ const addVirtualTrigger = () => {
108
+ if (!virtualTrigger.value.type) {
109
+ return
110
+ }
111
+
112
+ modelValue.value.push({
113
+ type: virtualTrigger.value.type,
114
+ // TODO: finalize type for Trigger["type"]
115
+ settings: createSettingsObject(virtualTrigger.value.type),
116
+ })
117
+ virtualTrigger.value.type = ""
118
+ }
119
+
120
+ const createSettingsObject = (
121
+ triggerType: (typeof triggerTypes)[number] | string,
122
+ // TODO: finalize type Trigger["settings"]
123
+ ): Trigger["settings"] => {
124
+ if (
125
+ triggerType === "page-navigation" ||
126
+ triggerType === "top-navigation" ||
127
+ triggerType === "user-menu"
128
+ ) {
129
+ const clickLink = {
130
+ icon: null,
131
+ // TODO: create dynamic LocalizedObject
132
+ title: {
133
+ default: "",
134
+ de: "",
135
+ en: "",
136
+ },
137
+ sortOrder: 0,
138
+ }
139
+ if (triggerType === "page-navigation") {
140
+ clickLink.navigationBarType = "navItem"
141
+ }
142
+ return clickLink
143
+ }
144
+ if (triggerType === "shortcut") {
145
+ // TODO: define shortcuts and create input for it
146
+ return {
147
+ shortcuts: [],
148
+ }
149
+ }
150
+
151
+ return {}
152
+ }
153
+
154
+ // update the settings object of the updated trigger
155
+ const updateTriggerType = (
156
+ triggerType: (typeof triggerTypes)[number] | string,
157
+ index: number,
158
+ ) => (modelValue.value[index].settings = createSettingsObject(triggerType))
159
+ </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <v-select
3
+ v-if="data"
4
+ :id="inputId"
5
+ v-model="modelValue"
6
+ variant="outlined"
7
+ :items="filteredUsers"
8
+ :item-title="getEmail"
9
+ item-value="_id"
10
+ :label="$t('workbench.dynamicInputs.user.label')"
11
+ />
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { useUserHelper } from "@app/composables/useUserHelper"
16
+ import { User } from "@raclettejs/core"
17
+ import { usePluginApi } from "@raclettejs/core/orchestrator/composables"
18
+ import { computed } from "vue"
19
+ import { useI18n } from "vue-i18n"
20
+
21
+ const props = defineProps<{
22
+ inputId?: string
23
+ excludedIds?: string[]
24
+ }>()
25
+
26
+ const modelValue = defineModel<string>({ required: true })
27
+
28
+ const { t } = useI18n()
29
+ const { $data } = usePluginApi("raclette__core")
30
+
31
+ const { data } = $data.user.getAll({
32
+ options: { immediate: true },
33
+ })
34
+
35
+ const users = computed<User[]>(() => Object.values(data.value || {}))
36
+
37
+ const filteredUsers = computed(() =>
38
+ users.value.filter((user) => {
39
+ const isCurrentUser = user._id === modelValue.value
40
+ const userIsExcluded = props.excludedIds?.includes(user._id)
41
+
42
+ return isCurrentUser || !userIsExcluded
43
+ }),
44
+ )
45
+
46
+ const getEmail = (user?: User) => {
47
+ if (user) {
48
+ return user.email
49
+ }
50
+
51
+ return t("workbench.dynamicInputs.user.placeholder")
52
+ }
53
+ const getUserFullName = (user?: User) => {
54
+ debugger
55
+ if (user) {
56
+ const { email } = useUserHelper(user)
57
+
58
+ return email.value
59
+ }
60
+
61
+ return t("workbench.dynamicInputs.user.placeholder")
62
+ }
63
+ </script>