-
-
Installed
-
-
-
-
-
-
{{ addon.name }}
-
-
+
+
+
Installed
+
+
+
+
+
+
{{ addon.name }}
+
+
+
+
+
-
-
-
+
diff --git a/resources/js/components/App.vue b/resources/js/components/App.vue
new file mode 100644
index 00000000000..9f6bcae10ec
--- /dev/null
+++ b/resources/js/components/App.vue
@@ -0,0 +1,133 @@
+
diff --git a/resources/js/components/AssetContainerList.vue b/resources/js/components/AssetContainerList.vue
index b3b5773350d..5b01586373f 100644
--- a/resources/js/components/AssetContainerList.vue
+++ b/resources/js/components/AssetContainerList.vue
@@ -1,18 +1,21 @@
-
+
+
+
@@ -28,7 +31,7 @@ export default {
data() {
return {
rows: this.initialRows
- }
+ };
},
methods: {
@@ -43,5 +46,5 @@ export default {
}
-}
+};
diff --git a/resources/js/components/Bard.js b/resources/js/components/Bard.js
index bfa8991eaf4..c2b15568355 100644
--- a/resources/js/components/Bard.js
+++ b/resources/js/components/Bard.js
@@ -1,5 +1,5 @@
import * as core from '@tiptap/core';
-import * as vue2 from '@tiptap/vue-2';
+import * as vue2 from '@tiptap/vue-3';
import * as state from '@tiptap/pm/state';
import * as model from '@tiptap/pm/model';
import * as view from '@tiptap/pm/view';
diff --git a/resources/js/components/Component.js b/resources/js/components/Component.js
index 40455835e69..7770e4fe60f 100644
--- a/resources/js/components/Component.js
+++ b/resources/js/components/Component.js
@@ -1,24 +1,23 @@
class Component {
-
constructor(id, name, props) {
this.id = id;
this.name = name;
- this.props = props;
- this.events = {};
+ this.props = reactive(props); // Make props reactive
+ this.events = reactive({});
}
prop(prop, value) {
- this.props[prop] = value;
+ this.props[prop] = value; // Directly set the property, Vue 3's reactivity system will track it
}
on(event, handler) {
- Vue.set(this.events, event, handler);
+ this.events[event] = handler; // Directly set the event handler
}
destroy() {
+ // Ensure Statamic is properly imported or available in your context
Statamic.$components.destroy(this.id);
}
-
}
export default Component;
diff --git a/resources/js/components/Components.js b/resources/js/components/Components.js
index 2ada42f068e..518b4094f9b 100644
--- a/resources/js/components/Components.js
+++ b/resources/js/components/Components.js
@@ -2,15 +2,15 @@ import uniqid from 'uniqid';
import Component from './Component';
class Components {
-
constructor(root) {
this.$root = root;
}
register(name, component) {
- Vue.component(name, component);
+ this.$root.component(name, component)
}
+ // @todo(jelleroorda): check if this still works
append(name, { props }) {
const id = `appended-${uniqid()}`;
const component = new Component(id, name, props);
@@ -33,6 +33,7 @@ class Components {
if (appended) {
const index = _.indexOf(this.$root.appendedComponents, appended);
+
this.$root.appendedComponents.splice(index, 1);
}
}
diff --git a/resources/js/components/Config.js b/resources/js/components/Config.js
index 467c9d00489..473f59a645a 100644
--- a/resources/js/components/Config.js
+++ b/resources/js/components/Config.js
@@ -1,12 +1,10 @@
-import Vue from 'vue';
-
class Config {
- constructor(instance) {
- this.instance = instance;
+ constructor(store) {
+ this.store = store;
}
all() {
- return this.instance.$store.state.statamic.config;
+ return this.store.state.statamic.config;
}
get(key, fallback) {
@@ -14,14 +12,8 @@ class Config {
}
set(key, value) {
- this.instance.$store.commit('statamic/configValue', {key, value});
+ this.store.commit('statamic/configValue', {key, value});
}
}
-Object.defineProperties(Vue.prototype, {
- $config: {
- get() {
- return new Config(this);
- }
- }
-});
+export default Config;
diff --git a/resources/js/components/DarkModeToggle.vue b/resources/js/components/DarkModeToggle.vue
index 53b4fbca5dc..72f6decfe7a 100644
--- a/resources/js/components/DarkModeToggle.vue
+++ b/resources/js/components/DarkModeToggle.vue
@@ -1,23 +1,28 @@
-
-
-
+
+
+
+
+
{{ __('Light') }}
+
{{ __('Dark') }}
+
{{ __('System') }}
-
+
+
diff --git a/resources/js/components/DirtyState.js b/resources/js/components/DirtyState.js
deleted file mode 100644
index 0f056f3b20c..00000000000
--- a/resources/js/components/DirtyState.js
+++ /dev/null
@@ -1,79 +0,0 @@
-import Vue from 'vue'
-
-const vm = new Vue({
-
- data: {
- names: []
- },
-
- watch: {
-
- names(names) {
- if (names.length) {
- this.enableWarning();
- }
-
- if (names.length === 0) {
- this.disableWarning();
- }
- }
-
- },
-
- methods: {
-
- add(name) {
- if (this.names.indexOf(name) == -1) {
- this.names.push(name);
- }
- },
-
- remove(name) {
- this.names = this.names.filter(n => n !== name);
- },
-
- enableWarning() {
- if (Statamic.$preferences.get('confirm_dirty_navigation', true)) {
- window.onbeforeunload = () => '';
- }
- },
-
- disableWarning() {
- window.onbeforeunload = null;
- }
-
- }
-
-});
-
-class DirtyState {
- state(name, state) {
- state ? this.add(name) : this.remove(name);
- }
- add(name) {
- vm.add(name);
- }
- remove(name) {
- vm.remove(name);
- }
- names() {
- return vm.names;
- }
- count() {
- return vm.names.length;
- }
- has(name) {
- return vm.names.includes(name);
- }
- disableWarning() {
- vm.disableWarning();
- }
-}
-
-Object.defineProperties(Vue.prototype, {
- $dirty: {
- get() {
- return new DirtyState;
- }
- }
-});
diff --git a/resources/js/components/DropdownItem.vue b/resources/js/components/DropdownItem.vue
index a1fe9b2ab7e..f2ab18d4ed6 100644
--- a/resources/js/components/DropdownItem.vue
+++ b/resources/js/components/DropdownItem.vue
@@ -8,36 +8,24 @@
diff --git a/resources/js/components/DropdownList.vue b/resources/js/components/DropdownList.vue
index cb90e5cb0ff..042e5be4337 100644
--- a/resources/js/components/DropdownList.vue
+++ b/resources/js/components/DropdownList.vue
@@ -1,18 +1,35 @@
-
+
-
+
+
+
+
+
-
+
+
+
+
diff --git a/resources/js/components/ElementContainer.vue b/resources/js/components/ElementContainer.vue
index a2f275037eb..1a0ca294984 100644
--- a/resources/js/components/ElementContainer.vue
+++ b/resources/js/components/ElementContainer.vue
@@ -1,7 +1,9 @@
diff --git a/resources/js/components/FavoriteCreator.vue b/resources/js/components/FavoriteCreator.vue
index 12266b0a41d..0e03a43beb2 100644
--- a/resources/js/components/FavoriteCreator.vue
+++ b/resources/js/components/FavoriteCreator.vue
@@ -1,11 +1,12 @@
-
-
diff --git a/resources/js/components/Modal.vue b/resources/js/components/Modal.vue
index e8d4df5b900..fc8f3623a3b 100644
--- a/resources/js/components/Modal.vue
+++ b/resources/js/components/Modal.vue
@@ -1,81 +1,70 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/components/ModalDialog.vue b/resources/js/components/ModalDialog.vue
index 8bc63585709..3f9ace36201 100644
--- a/resources/js/components/ModalDialog.vue
+++ b/resources/js/components/ModalDialog.vue
@@ -1,7 +1,7 @@