@alpinejs/docs 3.10.2-revision.1 → 3.10.2-revision.2
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/package.json +1 -1
- package/src/en/magics/store.md +1 -1
- package/src/en/plugins/focus.md +10 -10
- package/src/en/plugins/mask.md +1 -1
- package/src/en/plugins/morph.md +11 -11
package/package.json
CHANGED
package/src/en/magics/store.md
CHANGED
|
@@ -6,7 +6,7 @@ title: store
|
|
|
6
6
|
|
|
7
7
|
# $store
|
|
8
8
|
|
|
9
|
-
You can use `$store` to conveniently access global Alpine stores registered using [`Alpine.store(...)`](/
|
|
9
|
+
You can use `$store` to conveniently access global Alpine stores registered using [`Alpine.store(...)`](/globals/alpine-store). For example:
|
|
10
10
|
|
|
11
11
|
```alpine
|
|
12
12
|
<button x-data @click="$store.darkMode.toggle()">Toggle Dark Mode</button>
|
package/src/en/plugins/focus.md
CHANGED
|
@@ -280,7 +280,7 @@ For example:
|
|
|
280
280
|
<!-- START_VERBATIM -->
|
|
281
281
|
<div class="demo">
|
|
282
282
|
<div
|
|
283
|
-
x-data="{ open: false }"
|
|
283
|
+
x-data="{ open: false }"
|
|
284
284
|
x-trap.noreturn="open"
|
|
285
285
|
@click.outside="open = false"
|
|
286
286
|
@keyup.escape.prevent.stop="open = false"
|
|
@@ -345,9 +345,9 @@ Let's walk through a few examples of these utilities in use. The example below a
|
|
|
345
345
|
@keydown.right="$focus.next()"
|
|
346
346
|
@keydown.left="$focus.previous()"
|
|
347
347
|
>
|
|
348
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
349
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
350
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
348
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
|
|
349
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
|
|
350
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
|
|
351
351
|
</div>
|
|
352
352
|
(Click a button, then use the arrow keys to move left and right)
|
|
353
353
|
</div>
|
|
@@ -373,9 +373,9 @@ Notice how if the last button is focused, pressing "right arrow" won't do anythi
|
|
|
373
373
|
@keydown.right="$focus.wrap().next()"
|
|
374
374
|
@keydown.left="$focus.wrap().previous()"
|
|
375
375
|
>
|
|
376
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
377
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
378
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
376
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
|
|
377
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
|
|
378
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
|
|
379
379
|
</div>
|
|
380
380
|
(Click a button, then use the arrow keys to move left and right)
|
|
381
381
|
</div>
|
|
@@ -410,9 +410,9 @@ Now, let's add two buttons, one to focus the first element in the button group,
|
|
|
410
410
|
@keydown.right="$focus.wrap().next()"
|
|
411
411
|
@keydown.left="$focus.wrap().previous()"
|
|
412
412
|
>
|
|
413
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
414
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
415
|
-
<button class="focus:outline-none focus:ring-2 focus:ring-
|
|
413
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
|
|
414
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
|
|
415
|
+
<button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
|
|
416
416
|
</div>
|
|
417
417
|
</div>
|
|
418
418
|
<!-- END_VERBATIM -->
|
package/src/en/plugins/mask.md
CHANGED
|
@@ -54,7 +54,7 @@ Alpine.plugin(mask)
|
|
|
54
54
|
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
|
-
<button :aria-expanded="expanded" @click="expanded = ! expanded" class="text-
|
|
57
|
+
<button :aria-expanded="expanded" @click="expanded = ! expanded" class="text-cyan-600 font-medium underline">
|
|
58
58
|
<span x-text="expanded ? 'Hide' : 'Show more'">Show</span> <span x-text="expanded ? '↑' : '↓'">↓</span>
|
|
59
59
|
</button>
|
|
60
60
|
</div>
|
package/src/en/plugins/morph.md
CHANGED
|
@@ -21,10 +21,10 @@ The best way to understand its purpose is with the following interactive visuali
|
|
|
21
21
|
|
|
22
22
|
<div class="flex w-full justify-between" style="padding-bottom: 1rem">
|
|
23
23
|
<div class="w-1/2 px-4">
|
|
24
|
-
<button @click="slide = (slide === 1) ? 13 : slide - 1" class="w-full bg-
|
|
24
|
+
<button @click="slide = (slide === 1) ? 13 : slide - 1" class="w-full bg-cyan-400 rounded-full text-center py-3 font-bold text-white">Previous</button>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="w-1/2 px-4">
|
|
27
|
-
<button @click="slide = (slide % 13) + 1" class="w-full bg-
|
|
27
|
+
<button @click="slide = (slide % 13) + 1" class="w-full bg-cyan-400 rounded-full text-center py-3 font-bold text-white">Next</button>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
@@ -82,8 +82,8 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
|
|
|
82
82
|
|
|
83
83
|
```alpine
|
|
84
84
|
<div x-data="{ message: 'Change me, then press the button!' }">
|
|
85
|
-
<input type="text" x-model="message">
|
|
86
|
-
<span x-text="message"></span>
|
|
85
|
+
<input type="text" x-model="message">
|
|
86
|
+
<span x-text="message"></span>
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
89
|
<button>Run Morph</button>
|
|
@@ -95,9 +95,9 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
|
|
|
95
95
|
Alpine.morph(el, `
|
|
96
96
|
<div x-data="{ message: 'Change me, then press the button!' }">
|
|
97
97
|
<h2>See how new elements have been added</h2>
|
|
98
|
-
|
|
99
|
-
<input type="text" x-model="message">
|
|
100
|
-
<span x-text="message"></span>
|
|
98
|
+
|
|
99
|
+
<input type="text" x-model="message">
|
|
100
|
+
<span x-text="message"></span>
|
|
101
101
|
|
|
102
102
|
<h2>but the state of this component hasn't changed? Magical.</h2>
|
|
103
103
|
</div>
|
|
@@ -110,9 +110,9 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
|
|
|
110
110
|
<div class="demo">
|
|
111
111
|
<div x-data="{ message: 'Change me, then press the button!' }" id="morph-demo-1" class="space-y-2">
|
|
112
112
|
<input type="text" x-model="message" class="w-full">
|
|
113
|
-
<span x-text="message"></span>
|
|
113
|
+
<span x-text="message"></span>
|
|
114
114
|
</div>
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
<button id="morph-button-1" class="mt-4">Run Morph</button>
|
|
117
117
|
</div>
|
|
118
118
|
|
|
@@ -123,8 +123,8 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
|
|
|
123
123
|
Alpine.morph(el, `
|
|
124
124
|
<div x-data="{ message: 'Change me, then press the button!' }" id="morph-demo-1" class="space-y-2">
|
|
125
125
|
<h4>See how new elements have been added</h4>
|
|
126
|
-
<input type="text" x-model="message" class="w-full">
|
|
127
|
-
<span x-text="message"></span>
|
|
126
|
+
<input type="text" x-model="message" class="w-full">
|
|
127
|
+
<span x-text="message"></span>
|
|
128
128
|
<h4>but the state of this component hasn't changed? Magical.</h4>
|
|
129
129
|
</div>
|
|
130
130
|
`)
|