@php-script/editor-vue 0.0.0-stage → 0.1.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.
package/README.md CHANGED
@@ -1,3 +1,32 @@
1
- # Temporary Holding Version
1
+ # @php-script/editor-vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/@php-script/editor-vue?label=npm)](https://www.npmjs.com/package/@php-script/editor-vue)
4
+ [![Downloads](https://img.shields.io/npm/dm/@php-script/editor-vue?label=downloads)](https://www.npmjs.com/package/@php-script/editor-vue)
5
+
6
+ Documentation: https://php-script.github.io/php-script-editor/packages/vue.html
7
+
8
+ Vue 3 wrapper for the `<php-script-editor>` web component, with `v-model`. Loads the element on the client only, so it is safe with Nuxt SSR.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm i @php-script/editor-vue monaco-editor
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```vue
19
+ <script setup lang="ts">
20
+ import { ref } from 'vue';
21
+ import { PhpScriptEditor } from '@php-script/editor-vue';
22
+
23
+ const code = ref('echo "Hello";');
24
+ </script>
25
+
26
+ <template>
27
+ <PhpScriptEditor v-model="code" config-url="/php-script/config" />
28
+ </template>
29
+ ```
30
+
31
+ See the [documentation](https://php-script.github.io/php-script-editor/packages/vue.html) for all props, events and methods, and
32
+ [Server and language config](https://php-script.github.io/php-script-editor/server.html) for the endpoints.
@@ -0,0 +1,225 @@
1
+ import { type App, type PropType } from 'vue';
2
+ import type { LintDiagnostic, PhpScriptConfig, PhpScriptEditor as PhpScriptEditorElement, PhpScriptTheme, SaveMethod, SaveResult, ThemeMode } from '@php-script/editor';
3
+ export type { LintDiagnostic, PhpScriptConfig, PhpScriptTheme, SaveResult, PhpScriptEditorElement };
4
+ /** Loads and registers the custom element in the browser only (SSR/Nuxt-safe). */
5
+ export declare const loadPhpScriptEditor: () => Promise<unknown>;
6
+ /**
7
+ * `<PhpScriptEditor v-model="code" :config="config" save-url="/scripts" />`
8
+ *
9
+ * Tell Vue that `php-script-editor` is a custom element when you use the tag directly:
10
+ * `compilerOptions.isCustomElement: (tag) => tag === 'php-script-editor'`.
11
+ * This wrapper renders it via `h()`, so it needs no compiler option.
12
+ */
13
+ export declare const PhpScriptEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
14
+ modelValue: {
15
+ type: StringConstructor;
16
+ default: undefined;
17
+ };
18
+ config: {
19
+ type: PropType<PhpScriptConfig | string | null>;
20
+ default: undefined;
21
+ };
22
+ configUrl: {
23
+ type: StringConstructor;
24
+ default: undefined;
25
+ };
26
+ saveUrl: {
27
+ type: StringConstructor;
28
+ default: undefined;
29
+ };
30
+ saveMethod: {
31
+ type: PropType<SaveMethod>;
32
+ default: undefined;
33
+ };
34
+ saveField: {
35
+ type: StringConstructor;
36
+ default: undefined;
37
+ };
38
+ saveHeaders: {
39
+ type: PropType<Record<string, string>>;
40
+ default: undefined;
41
+ };
42
+ savePayload: {
43
+ type: PropType<Record<string, unknown>>;
44
+ default: undefined;
45
+ };
46
+ persisted: {
47
+ type: BooleanConstructor;
48
+ default: undefined;
49
+ };
50
+ csrfToken: {
51
+ type: StringConstructor;
52
+ default: undefined;
53
+ };
54
+ lintUrl: {
55
+ type: StringConstructor;
56
+ default: undefined;
57
+ };
58
+ lintDelay: {
59
+ type: NumberConstructor;
60
+ default: undefined;
61
+ };
62
+ theme: {
63
+ type: PropType<ThemeMode | PhpScriptTheme>;
64
+ default: undefined;
65
+ };
66
+ readonly: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ name: {
71
+ type: StringConstructor;
72
+ default: undefined;
73
+ };
74
+ options: {
75
+ type: PropType<Record<string, unknown>>;
76
+ default: undefined;
77
+ };
78
+ labels: {
79
+ type: PropType<Record<string, string>>;
80
+ default: undefined;
81
+ };
82
+ noToolbar: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ noSaveShortcut: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ /** CSS height, e.g. `24rem`. */
91
+ height: {
92
+ type: StringConstructor;
93
+ default: undefined;
94
+ };
95
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
96
+ [key: string]: any;
97
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
98
+ 'update:modelValue': (_value: string) => true;
99
+ change: (_value: string) => true;
100
+ ready: (_editor: unknown, _element: PhpScriptEditorElement) => true;
101
+ 'save-start': (_event: CustomEvent) => true;
102
+ saved: (_result: SaveResult & {
103
+ value: string;
104
+ }) => true;
105
+ 'save-error': (_error: Error) => true;
106
+ diagnostics: (_diagnostics: LintDiagnostic[]) => true;
107
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
108
+ modelValue: {
109
+ type: StringConstructor;
110
+ default: undefined;
111
+ };
112
+ config: {
113
+ type: PropType<PhpScriptConfig | string | null>;
114
+ default: undefined;
115
+ };
116
+ configUrl: {
117
+ type: StringConstructor;
118
+ default: undefined;
119
+ };
120
+ saveUrl: {
121
+ type: StringConstructor;
122
+ default: undefined;
123
+ };
124
+ saveMethod: {
125
+ type: PropType<SaveMethod>;
126
+ default: undefined;
127
+ };
128
+ saveField: {
129
+ type: StringConstructor;
130
+ default: undefined;
131
+ };
132
+ saveHeaders: {
133
+ type: PropType<Record<string, string>>;
134
+ default: undefined;
135
+ };
136
+ savePayload: {
137
+ type: PropType<Record<string, unknown>>;
138
+ default: undefined;
139
+ };
140
+ persisted: {
141
+ type: BooleanConstructor;
142
+ default: undefined;
143
+ };
144
+ csrfToken: {
145
+ type: StringConstructor;
146
+ default: undefined;
147
+ };
148
+ lintUrl: {
149
+ type: StringConstructor;
150
+ default: undefined;
151
+ };
152
+ lintDelay: {
153
+ type: NumberConstructor;
154
+ default: undefined;
155
+ };
156
+ theme: {
157
+ type: PropType<ThemeMode | PhpScriptTheme>;
158
+ default: undefined;
159
+ };
160
+ readonly: {
161
+ type: BooleanConstructor;
162
+ default: boolean;
163
+ };
164
+ name: {
165
+ type: StringConstructor;
166
+ default: undefined;
167
+ };
168
+ options: {
169
+ type: PropType<Record<string, unknown>>;
170
+ default: undefined;
171
+ };
172
+ labels: {
173
+ type: PropType<Record<string, string>>;
174
+ default: undefined;
175
+ };
176
+ noToolbar: {
177
+ type: BooleanConstructor;
178
+ default: boolean;
179
+ };
180
+ noSaveShortcut: {
181
+ type: BooleanConstructor;
182
+ default: boolean;
183
+ };
184
+ /** CSS height, e.g. `24rem`. */
185
+ height: {
186
+ type: StringConstructor;
187
+ default: undefined;
188
+ };
189
+ }>> & Readonly<{
190
+ "onUpdate:modelValue"?: ((_value: string) => any) | undefined;
191
+ onChange?: ((_value: string) => any) | undefined;
192
+ onReady?: ((_editor: unknown, _element: PhpScriptEditorElement) => any) | undefined;
193
+ "onSave-start"?: ((_event: CustomEvent<any>) => any) | undefined;
194
+ onSaved?: ((_result: SaveResult & {
195
+ value: string;
196
+ }) => any) | undefined;
197
+ "onSave-error"?: ((_error: Error) => any) | undefined;
198
+ onDiagnostics?: ((_diagnostics: LintDiagnostic[]) => any) | undefined;
199
+ }>, {
200
+ config: string | PhpScriptConfig | null;
201
+ configUrl: string;
202
+ saveUrl: string;
203
+ saveMethod: string;
204
+ saveField: string;
205
+ saveHeaders: Record<string, string>;
206
+ savePayload: Record<string, unknown>;
207
+ persisted: boolean;
208
+ csrfToken: string;
209
+ lintUrl: string;
210
+ lintDelay: number;
211
+ theme: ThemeMode | PhpScriptTheme;
212
+ readonly: boolean;
213
+ name: string;
214
+ options: Record<string, unknown>;
215
+ labels: Record<string, string>;
216
+ noToolbar: boolean;
217
+ noSaveShortcut: boolean;
218
+ modelValue: string;
219
+ height: string;
220
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
221
+ /** `app.use(PhpScriptEditorPlugin)` registers `<PhpScriptEditor>` globally. */
222
+ export declare const PhpScriptEditorPlugin: {
223
+ install(app: App): void;
224
+ };
225
+ export default PhpScriptEditor;
package/dist/index.js ADDED
@@ -0,0 +1,128 @@
1
+ import { defineComponent, h, onBeforeUnmount, onMounted, ref, shallowRef, watch, } from 'vue';
2
+ import { applyChangedProps } from '@php-script/editor/core';
3
+ let loader = null;
4
+ /** Loads and registers the custom element in the browser only (SSR/Nuxt-safe). */
5
+ export const loadPhpScriptEditor = () => (loader ??= import('@php-script/editor'));
6
+ const PROPS = [
7
+ 'config',
8
+ 'configUrl',
9
+ 'saveUrl',
10
+ 'saveMethod',
11
+ 'saveField',
12
+ 'saveHeaders',
13
+ 'savePayload',
14
+ 'persisted',
15
+ 'csrfToken',
16
+ 'lintUrl',
17
+ 'lintDelay',
18
+ 'theme',
19
+ 'readonly',
20
+ 'name',
21
+ 'options',
22
+ 'labels',
23
+ 'noToolbar',
24
+ 'noSaveShortcut',
25
+ ];
26
+ /**
27
+ * `<PhpScriptEditor v-model="code" :config="config" save-url="/scripts" />`
28
+ *
29
+ * Tell Vue that `php-script-editor` is a custom element when you use the tag directly:
30
+ * `compilerOptions.isCustomElement: (tag) => tag === 'php-script-editor'`.
31
+ * This wrapper renders it via `h()`, so it needs no compiler option.
32
+ */
33
+ export const PhpScriptEditor = defineComponent({
34
+ name: 'PhpScriptEditor',
35
+ props: {
36
+ modelValue: { type: String, default: undefined },
37
+ config: {
38
+ type: [Object, String],
39
+ default: undefined,
40
+ },
41
+ configUrl: { type: String, default: undefined },
42
+ saveUrl: { type: String, default: undefined },
43
+ saveMethod: { type: String, default: undefined },
44
+ saveField: { type: String, default: undefined },
45
+ saveHeaders: { type: Object, default: undefined },
46
+ savePayload: { type: Object, default: undefined },
47
+ persisted: { type: Boolean, default: undefined },
48
+ csrfToken: { type: String, default: undefined },
49
+ lintUrl: { type: String, default: undefined },
50
+ lintDelay: { type: Number, default: undefined },
51
+ theme: { type: [String, Object], default: undefined },
52
+ readonly: { type: Boolean, default: false },
53
+ name: { type: String, default: undefined },
54
+ options: { type: Object, default: undefined },
55
+ labels: { type: Object, default: undefined },
56
+ noToolbar: { type: Boolean, default: false },
57
+ noSaveShortcut: { type: Boolean, default: false },
58
+ /** CSS height, e.g. `24rem`. */
59
+ height: { type: String, default: undefined },
60
+ },
61
+ emits: {
62
+ 'update:modelValue': (_value) => true,
63
+ change: (_value) => true,
64
+ ready: (_editor, _element) => true,
65
+ 'save-start': (_event) => true,
66
+ saved: (_result) => true,
67
+ 'save-error': (_error) => true,
68
+ diagnostics: (_diagnostics) => true,
69
+ },
70
+ setup(props, { emit, expose }) {
71
+ const element = shallowRef(null);
72
+ const loaded = ref(false);
73
+ const cleanups = [];
74
+ const synced = new Map();
75
+ const sync = () => {
76
+ const el = element.value;
77
+ if (!el)
78
+ return;
79
+ const next = {};
80
+ for (const key of PROPS)
81
+ next[key] = props[key];
82
+ applyChangedProps(el, next, synced);
83
+ if (props.modelValue !== undefined && el.value !== props.modelValue)
84
+ el.value = props.modelValue;
85
+ };
86
+ onMounted(async () => {
87
+ const el = element.value;
88
+ sync();
89
+ const on = (type, handler) => {
90
+ const listener = (event) => handler(event);
91
+ el.addEventListener(type, listener);
92
+ cleanups.push(() => el.removeEventListener(type, listener));
93
+ };
94
+ on('ps-change', (e) => emit('update:modelValue', e.detail.value));
95
+ on('change', () => emit('change', el.value));
96
+ on('ps-ready', (e) => emit('ready', e.detail.editor, el));
97
+ on('ps-save-start', (e) => emit('save-start', e));
98
+ on('ps-saved', (e) => emit('saved', e.detail));
99
+ on('ps-save-error', (e) => emit('save-error', e.detail.error));
100
+ on('ps-diagnostics', (e) => emit('diagnostics', e.detail.diagnostics));
101
+ await loadPhpScriptEditor();
102
+ loaded.value = true;
103
+ });
104
+ onBeforeUnmount(() => cleanups.splice(0).forEach((fn) => fn()));
105
+ watch(() => ({ ...props }), sync, { flush: 'post' });
106
+ expose({
107
+ element,
108
+ get editor() {
109
+ return element.value?.editor ?? null;
110
+ },
111
+ save: () => element.value.save(),
112
+ lint: () => element.value?.lint() ?? Promise.resolve([]),
113
+ focus: () => element.value?.focus(),
114
+ });
115
+ return () => h('php-script-editor', {
116
+ ref: element,
117
+ style: props.height ? { '--php-script-editor-height': props.height } : undefined,
118
+ });
119
+ },
120
+ });
121
+ /** `app.use(PhpScriptEditorPlugin)` registers `<PhpScriptEditor>` globally. */
122
+ export const PhpScriptEditorPlugin = {
123
+ install(app) {
124
+ app.component('PhpScriptEditor', PhpScriptEditor);
125
+ },
126
+ };
127
+ export default PhpScriptEditor;
128
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,eAAe,EACf,SAAS,EACT,GAAG,EACH,UAAU,EACV,KAAK,GAGN,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAa5D,IAAI,MAAM,GAA4B,IAAI,CAAC;AAC3C,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAEnF,MAAM,KAAK,GAAG;IACZ,QAAQ;IACR,WAAW;IACX,SAAS;IACT,YAAY;IACZ,WAAW;IACX,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,OAAO;IACP,UAAU;IACV,MAAM;IACN,SAAS;IACT,QAAQ;IACR,WAAW;IACX,gBAAgB;CACR,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;IAC7C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE;QACL,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE;QAChD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA8C;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AAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,OAAO,CAAC,GAAQ;QACd,GAAG,CAAC,SAAS,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IACpD,CAAC;CACF,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@php-script/editor-vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Vue 3 wrapper for the <php-script-editor> web component (v-model support).",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "dependencies": {
20
+ "@php-script/editor": "^0.1.1"
21
+ },
22
+ "peerDependencies": {
23
+ "monaco-editor": ">=0.55.0 <1.0.0",
24
+ "vue": "^3.4.0"
25
+ },
26
+ "devDependencies": {
27
+ "@vitejs/plugin-vue": "^6.0.10",
28
+ "@vitest/browser-playwright": "^5.0.5",
29
+ "@vue/test-utils": "^2.5.1",
30
+ "monaco-editor": "^0.57.0",
31
+ "typescript": "~6.0.3",
32
+ "vite": "^8.3.5",
33
+ "vitest": "^5.0.5",
34
+ "vue": "^3.5.44",
35
+ "vue-tsc": "^3.3.14"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/php-script/php-script-editor.git",
40
+ "directory": "packages/vue"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "provenance": true
45
+ },
46
+ "scripts": {
47
+ "build": "vue-tsc -p tsconfig.build.json",
48
+ "typecheck": "vue-tsc -p tsconfig.json --noEmit",
49
+ "test": "vitest run"
50
+ }
6
51
  }