windly-ui 1.0.0 → 1.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.
@@ -1,137 +0,0 @@
1
- <template>
2
- <DocMegaSection
3
- title="Mini WYSIWYG Editor"
4
- sub-title="Demonstrates advanced Vue reactivity, history tracking, and DOM syncing."
5
- class="mx-4"
6
- >
7
- <DocComponent
8
- title="Reactive Editor with Undo/Redo"
9
- caption="A minimal rich-text editor built using contenteditable and Vue's Composition API."
10
- >
11
- <div class="grid md:grid-cols-2 gap-6">
12
- <div class="space-y-3">
13
- <div class="flex gap-2">
14
- <UIButton label="Undo" @click="undo" :disable="historyIndex <= 0" />
15
- <UIButton label="Redo" @click="redo" :disable="historyIndex >= history.length - 1" />
16
- <UIButton label="Clear" @click="clearEditor" color="red-400" />
17
- <UIButton label="Copy HTML" @click="copyHTML" color="green-500" />
18
- </div>
19
-
20
- <div
21
- ref="editorRef"
22
- contenteditable
23
- class="border rounded-md p-4 min-h-[200px] bg-white focus:outline-none"
24
- @input="handleInput"
25
- ></div>
26
- </div>
27
-
28
- <div>
29
- <h4 class="font-semibold mb-2">Live HTML Output</h4>
30
- <pre class="bg-gray-900 text-green-400 p-4 rounded-md text-sm overflow-auto">
31
- {{ html }}
32
- </pre>
33
- </div>
34
- </div>
35
- </DocComponent>
36
- </DocMegaSection>
37
- </template>
38
- <script setup>
39
- import { ref, computed, onMounted, onUnmounted } from 'vue'
40
-
41
- const editorRef = ref(null)
42
- const html = ref("")
43
-
44
- const history = ref([""])
45
- const historyIndex = ref(0)
46
-
47
- const MAX_HISTORY = 30
48
-
49
- let isProgrammaticUpdate = false
50
-
51
- let debounceTimer = null
52
- const debounce = (fn, delay = 300) => {
53
- clearTimeout(debounceTimer)
54
- debounceTimer = setTimeout(fn, delay)
55
- }
56
-
57
- const handleInput = () => {
58
- if (isProgrammaticUpdate) return
59
-
60
- debounce(() => {
61
- const value = editorRef.value.innerHTML
62
-
63
- if (value === history.value[historyIndex.value]) return
64
-
65
- history.value = history.value.slice(0, historyIndex.value + 1)
66
-
67
- history.value.push(value)
68
-
69
- if (history.value.length > MAX_HISTORY) {
70
- history.value.shift()
71
- } else {
72
- historyIndex.value++
73
- }
74
-
75
- historyIndex.value = history.value.length - 1
76
-
77
- html.value = value
78
- })
79
- }
80
-
81
- const updateEditorFromHistory = () => {
82
- const value = history.value[historyIndex.value]
83
-
84
- isProgrammaticUpdate = true
85
-
86
- html.value = value
87
- editorRef.value.innerHTML = value
88
-
89
- setTimeout(() => {
90
- isProgrammaticUpdate = false
91
- }, 0)
92
- }
93
-
94
- const undo = () => {
95
- if (historyIndex.value > 0) {
96
- historyIndex.value--
97
- updateEditorFromHistory()
98
- }
99
- }
100
-
101
- const redo = () => {
102
- if (historyIndex.value < history.value.length - 1) {
103
- historyIndex.value++
104
- updateEditorFromHistory()
105
- }
106
- }
107
-
108
- const clearEditor = () => {
109
- history.value = [""]
110
- historyIndex.value = 0
111
- updateEditorFromHistory()
112
- }
113
-
114
- const copyHTML = async () => {
115
- await navigator.clipboard.writeText(html.value)
116
- }
117
-
118
- const handleKeydown = (e) => {
119
- if (e.ctrlKey && e.key.toLowerCase() === "z") {
120
- e.preventDefault()
121
- undo()
122
- }
123
-
124
- if (e.ctrlKey && e.key.toLowerCase() === "y") {
125
- e.preventDefault()
126
- redo()
127
- }
128
- }
129
-
130
- onMounted(() => {
131
- window.addEventListener("keydown", handleKeydown)
132
- })
133
-
134
- onUnmounted(() => {
135
- window.removeEventListener("keydown", handleKeydown)
136
- })
137
- </script>
package/nuxt.config.ts DELETED
@@ -1,19 +0,0 @@
1
- // https://nuxt.com/docs/api/configuration/nuxt-config
2
- import UiLibraryModule from './ui-library/module'
3
-
4
- export default defineNuxtConfig({
5
- modules: ['@nuxtjs/tailwindcss', UiLibraryModule],
6
- css: ['~/assets/css/tailwind.css'],
7
- compatibilityDate: '2025-07-15',
8
- devtools: { enabled: true },
9
- app: {
10
- head: {
11
- link: [
12
- {
13
- rel: 'stylesheet',
14
- href: 'https://fonts.googleapis.com/icon?family=Material+Icons'
15
- }
16
- ]
17
- }
18
- }
19
- })
Binary file
Binary file
package/public/robots.txt DELETED
@@ -1,2 +0,0 @@
1
- User-Agent: *
2
- Disallow:
@@ -1,28 +0,0 @@
1
- // tailwind.config.js
2
- export default {
3
- content: [
4
- './app/**/*.{vue,js,ts}',
5
- './ui-library/components/**/*.{vue,js,ts}'
6
- ],
7
- safelist: [
8
- 'bg-white',
9
- 'text-white',
10
- 'border-white',
11
- 'ring-white',
12
- 'hover:bg-white',
13
- 'hover:text-white',
14
- 'bg-black',
15
- 'text-black',
16
- 'border-black',
17
- 'ring-black',
18
- 'hover:bg-black',
19
- 'hover:text-black',
20
- {
21
- pattern:
22
- /(bg|text|border|ring|to|from)-(white|black|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(50|100|200|300|400|500|600|700|800|900|950)?/,
23
- variants: ['hover', 'focus', 'active']
24
- }
25
- ],
26
- theme: { extend: {} },
27
- plugins: []
28
- }
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- // https://nuxt.com/docs/guide/concepts/typescript
3
- "files": [],
4
- "references": [
5
- {
6
- "path": "./.nuxt/tsconfig.app.json"
7
- },
8
- {
9
- "path": "./.nuxt/tsconfig.server.json"
10
- },
11
- {
12
- "path": "./.nuxt/tsconfig.shared.json"
13
- },
14
- {
15
- "path": "./.nuxt/tsconfig.node.json"
16
- }
17
- ]
18
- }