@cocreate/position 1.9.2 → 1.10.0
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/CHANGELOG.md +21 -0
- package/demo/index.html +1 -1
- package/docs/index.html +369 -416
- package/package.json +1 -1
- package/prettier.config.js +16 -0
- package/src/index.js +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [1.10.0](https://github.com/CoCreate-app/CoCreate-position/compare/v1.9.3...v1.10.0) (2024-11-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* observer taget has been renamed to selector ([cfa9028](https://github.com/CoCreate-app/CoCreate-position/commit/cfa9028e6031f68b6f851e91cd0335124e2283f9))
|
|
7
|
+
* pretier.config.js and file formating ([421b2a9](https://github.com/CoCreate-app/CoCreate-position/commit/421b2a94cf6d0fcf1b5b18b12b5d05d08739464d))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add prettier.config.js and format files ([48274b4](https://github.com/CoCreate-app/CoCreate-position/commit/48274b4ffbf93870ae3fa3911f0198db1f590a74))
|
|
13
|
+
* add prettier.config.js and format files ([a87c444](https://github.com/CoCreate-app/CoCreate-position/commit/a87c4444953ab1c084512707b8d6f90e74edcf58))
|
|
14
|
+
|
|
15
|
+
## [1.9.3](https://github.com/CoCreate-app/CoCreate-position/compare/v1.9.2...v1.9.3) (2024-09-21)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* comment postion.js script ([7a22366](https://github.com/CoCreate-app/CoCreate-position/commit/7a223667236511f5bcfd265503b9b68d5e3b6ca5))
|
|
21
|
+
|
|
1
22
|
## [1.9.2](https://github.com/CoCreate-app/CoCreate-position/compare/v1.9.1...v1.9.2) (2024-06-12)
|
|
2
23
|
|
|
3
24
|
|
package/demo/index.html
CHANGED
package/docs/index.html
CHANGED
|
@@ -1,153 +1,162 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<title>CoCreate-position Documentation | CoCreateJS</title>
|
|
8
|
+
<link
|
|
9
|
+
rel="icon"
|
|
10
|
+
type="image/png"
|
|
11
|
+
sizes="32x32"
|
|
12
|
+
href="https://cocreate.app/images/favicon.ico"
|
|
13
|
+
/>
|
|
14
|
+
<meta
|
|
15
|
+
name="description"
|
|
16
|
+
content="A draggable, customizable Pop up that toggle hiddent content via attributes. Great for multitasking and showing multiple views."
|
|
17
|
+
/>
|
|
18
|
+
<meta
|
|
19
|
+
name="keywords"
|
|
20
|
+
content="helper classes, utility classes, css framework, css library, inline style classes"
|
|
21
|
+
/>
|
|
22
|
+
<meta name="robots" content="index,follow" />
|
|
23
|
+
<meta
|
|
24
|
+
property="og:image"
|
|
25
|
+
content="https://cdn.cocreate.app/docs/position.png"
|
|
26
|
+
/>
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
<link
|
|
29
|
+
rel="stylesheet"
|
|
30
|
+
href="../index.css"
|
|
31
|
+
array="files"
|
|
32
|
+
object="60888216117c640e7596303f"
|
|
33
|
+
key="src"
|
|
34
|
+
type="text/css"
|
|
35
|
+
save="true"
|
|
36
|
+
/>
|
|
37
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
38
|
+
</head>
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
share-network="share"
|
|
102
|
-
title="Share on share"
|
|
103
|
-
><i src="/assets/svg/share-alt.svg"></i
|
|
104
|
-
></a>
|
|
105
|
-
</div>
|
|
106
|
-
<a
|
|
107
|
-
href="https://github.com/CoCreate-app/CoCreate-position"
|
|
108
|
-
target="_blank"
|
|
109
|
-
class="margin-right:15px"
|
|
110
|
-
><i src="/assets/svg/github.svg"></i
|
|
111
|
-
></a>
|
|
112
|
-
</div>
|
|
40
|
+
<body>
|
|
41
|
+
<!-- Navbar -->
|
|
42
|
+
<nav
|
|
43
|
+
class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
|
|
44
|
+
content_id="content"
|
|
45
|
+
scroll="sticky-nav,"
|
|
46
|
+
scroll-up="5"
|
|
47
|
+
scroll-down="5"
|
|
48
|
+
path="../"
|
|
49
|
+
src="../components/navbar.html"
|
|
50
|
+
></nav>
|
|
51
|
+
<sidenav
|
|
52
|
+
id="menuL"
|
|
53
|
+
class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
|
|
54
|
+
resizable
|
|
55
|
+
resize-selector="[content_id='content']"
|
|
56
|
+
resize-property="margin-left"
|
|
57
|
+
resize-value="width"
|
|
58
|
+
>
|
|
59
|
+
<menu array="files" object="603717b07de7fb350ae9fec8" key="src"></menu>
|
|
60
|
+
<div resize="right"></div>
|
|
61
|
+
</sidenav>
|
|
62
|
+
<main
|
|
63
|
+
class="padding-top:15px padding:15px@lg@xl"
|
|
64
|
+
content_id="content"
|
|
65
|
+
id="CoCreate-position"
|
|
66
|
+
>
|
|
67
|
+
<div
|
|
68
|
+
class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px"
|
|
69
|
+
>
|
|
70
|
+
<div class="display:flex align-items:center">
|
|
71
|
+
<h2>CoCreate-position</h2>
|
|
72
|
+
</div>
|
|
73
|
+
<div
|
|
74
|
+
class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white"
|
|
75
|
+
>
|
|
76
|
+
<div
|
|
77
|
+
class="display:flex align-items:center transition:0.3s padding-left:10px"
|
|
78
|
+
share-network="true"
|
|
79
|
+
share-text="A draggable, customizable Pop up that toggle hiddent content via attributes. Great for multitasking and showing multiple views."
|
|
80
|
+
share-title="CoCreate-position"
|
|
81
|
+
share-height="600"
|
|
82
|
+
share-width="700"
|
|
83
|
+
share-media="https://cdn.cocreate.app/docs/position.png"
|
|
84
|
+
hover="display:block!important"
|
|
85
|
+
hover-selector=".social-networks"
|
|
86
|
+
>
|
|
87
|
+
<div class="display:none social-networks">
|
|
88
|
+
<a
|
|
89
|
+
class="margin-right:15px"
|
|
90
|
+
share-network="twitter"
|
|
91
|
+
title="Share on twitter"
|
|
92
|
+
><i src="/assets/svg/twitter.svg"></i
|
|
93
|
+
></a>
|
|
94
|
+
<a
|
|
95
|
+
class="margin-right:15px"
|
|
96
|
+
share-network="facebook"
|
|
97
|
+
title="Share on Facebook"
|
|
98
|
+
><i src="/assets/svg/facebook.svg"></i
|
|
99
|
+
></a>
|
|
100
|
+
<a
|
|
101
|
+
class="margin-right:15px"
|
|
102
|
+
share-network="instagram"
|
|
103
|
+
title="Share on instagram"
|
|
104
|
+
><i src="/assets/svg/instagram.svg"></i
|
|
105
|
+
></a>
|
|
113
106
|
</div>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
107
|
+
<a
|
|
108
|
+
class="margin-right:15px"
|
|
109
|
+
share-network="share"
|
|
110
|
+
title="Share on share"
|
|
111
|
+
><i src="/assets/svg/share-alt.svg"></i
|
|
112
|
+
></a>
|
|
113
|
+
</div>
|
|
114
|
+
<a
|
|
115
|
+
href="https://github.com/CoCreate-app/CoCreate-position"
|
|
116
|
+
target="_blank"
|
|
117
|
+
class="margin-right:15px"
|
|
118
|
+
><i src="/assets/svg/github.svg"></i
|
|
119
|
+
></a>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<h1
|
|
123
|
+
class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100"
|
|
124
|
+
>
|
|
125
|
+
A draggable, customizable Pop up that toggle hiddent content via
|
|
126
|
+
attributes. Great for multitasking and showing multiple views.
|
|
127
|
+
</h1>
|
|
128
|
+
<div id="xxxxx-section" class="display:flex flex-wrap:wrap">
|
|
129
|
+
<div
|
|
130
|
+
class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px"
|
|
131
|
+
>
|
|
132
|
+
<div
|
|
133
|
+
id="position-usage"
|
|
134
|
+
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
135
|
+
scroll
|
|
136
|
+
scroll-intersect="color:dodgerblue"
|
|
137
|
+
scroll-selector="#position-usage-section"
|
|
138
|
+
>
|
|
139
|
+
<span
|
|
140
|
+
class="display:flex align-items:center width:fit-content"
|
|
141
|
+
hover="display:block!important"
|
|
142
|
+
hover-selector="[href='#position-usage']"
|
|
143
|
+
>
|
|
144
|
+
<h2 class="padding:5px_0px">Usage</h2>
|
|
145
|
+
<a class="margin-left:10px display:none" href="#position-usage"
|
|
146
|
+
><i src="/assets/svg/link.svg"></i
|
|
147
|
+
></a>
|
|
148
|
+
</span>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="">
|
|
151
|
+
<p class="padding-top:15px">
|
|
152
|
+
CoCreate-position uses <a> tag.
|
|
153
|
+
</p>
|
|
154
|
+
<p class="padding-top:15px">
|
|
155
|
+
When you click <a> tag, position comes to the surface.
|
|
156
|
+
</p>
|
|
148
157
|
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
<div class="flex-grow:1 min-width:300px width:100%">
|
|
159
|
+
<pre>
|
|
151
160
|
<code class="language-html">
|
|
152
161
|
<button>
|
|
153
162
|
<a target="position" href="https://server.cocreate.app/CoCreate-adminUI/module_datatable.html"
|
|
@@ -164,281 +173,225 @@
|
|
|
164
173
|
</button>
|
|
165
174
|
</code>
|
|
166
175
|
</pre>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
276
|
-
<h4>
|
|
277
|
-
<span>position-header</span>
|
|
278
|
-
<span class="cocreate-badge success"
|
|
279
|
-
>boolean</span
|
|
280
|
-
>
|
|
281
|
-
<span class="cocreate-badge warning"
|
|
282
|
-
>optional</span
|
|
283
|
-
>
|
|
284
|
-
</h4>
|
|
285
|
-
<p>Attribute whether to show header or not.</p>
|
|
286
|
-
</li>
|
|
287
|
-
<li
|
|
288
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
289
|
-
<h4>
|
|
290
|
-
<span>position-x</span>
|
|
291
|
-
<span class="cocreate-badge success"
|
|
292
|
-
>string</span
|
|
293
|
-
>
|
|
294
|
-
<span class="cocreate-badge warning"
|
|
295
|
-
>optional</span
|
|
296
|
-
>
|
|
297
|
-
</h4>
|
|
298
|
-
<p>Position X of position.</p>
|
|
299
|
-
</li>
|
|
300
|
-
<li
|
|
301
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
302
|
-
<h4>
|
|
303
|
-
<span>position-y</span>
|
|
304
|
-
<span class="cocreate-badge success"
|
|
305
|
-
>string</span
|
|
306
|
-
>
|
|
307
|
-
<span class="cocreate-badge warning"
|
|
308
|
-
>optional</span
|
|
309
|
-
>
|
|
310
|
-
</h4>
|
|
311
|
-
<p>Position Y of position.</p>
|
|
312
|
-
</li>
|
|
313
|
-
<li
|
|
314
|
-
class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
315
|
-
<h4>
|
|
316
|
-
<span>open_in</span>
|
|
317
|
-
<span class="cocreate-badge success"
|
|
318
|
-
>string</span
|
|
319
|
-
>
|
|
320
|
-
<span class="cocreate-badge warning"
|
|
321
|
-
>optional</span
|
|
322
|
-
>
|
|
323
|
-
</h4>
|
|
324
|
-
<p>
|
|
325
|
-
Attribute where to show position in. "page" for
|
|
326
|
-
current page. "parent" for parent page. "root"
|
|
327
|
-
for root page.
|
|
328
|
-
</p>
|
|
329
|
-
</li>
|
|
330
|
-
</ul>
|
|
331
|
-
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
<div
|
|
179
|
+
id="position-attributes"
|
|
180
|
+
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
181
|
+
scroll
|
|
182
|
+
scroll-intersect="color:dodgerblue"
|
|
183
|
+
scroll-selector="#position-attributes-section"
|
|
184
|
+
>
|
|
185
|
+
<span
|
|
186
|
+
class="display:flex align-items:center width:fit-content"
|
|
187
|
+
hover="display:block!important"
|
|
188
|
+
hover-selector="[href='#position-attributes']"
|
|
189
|
+
>
|
|
190
|
+
<h2 class="padding:5px_0px">Attributes</h2>
|
|
191
|
+
<a
|
|
192
|
+
class="margin-left:10px display:none"
|
|
193
|
+
href="#position-attributes"
|
|
194
|
+
><i src="/assets/svg/link.svg"></i
|
|
195
|
+
></a>
|
|
196
|
+
</span>
|
|
197
|
+
</div>
|
|
198
|
+
<ul class="list-style-type:none">
|
|
199
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
200
|
+
<h4>
|
|
201
|
+
<span>target</span>
|
|
202
|
+
<span class="cocreate-badge success">string</span>
|
|
203
|
+
<span class="cocreate-badge danger">required</span>
|
|
204
|
+
</h4>
|
|
205
|
+
<p>Target must be "position".</p>
|
|
206
|
+
</li>
|
|
207
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
208
|
+
<h4>
|
|
209
|
+
<span>href</span>
|
|
210
|
+
<span class="cocreate-badge success">string</span>
|
|
211
|
+
<span class="cocreate-badge danger">required</span>
|
|
212
|
+
</h4>
|
|
213
|
+
<p>Href attribute indicates html file to set in position.</p>
|
|
214
|
+
</li>
|
|
215
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
216
|
+
<h4>
|
|
217
|
+
<span>position-ajax</span>
|
|
218
|
+
<span class="cocreate-badge success">boolean</span>
|
|
219
|
+
<span class="cocreate-badge warning">optional</span>
|
|
220
|
+
</h4>
|
|
221
|
+
<p>Attribute whether to use ajax or not.</p>
|
|
222
|
+
</li>
|
|
223
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
224
|
+
<h4>
|
|
225
|
+
<span>position-width</span>
|
|
226
|
+
<span class="cocreate-badge success">string</span>
|
|
227
|
+
<span class="cocreate-badge warning">optional</span>
|
|
228
|
+
</h4>
|
|
229
|
+
<p>Width of position. Unit can be pixel or percent.</p>
|
|
230
|
+
</li>
|
|
231
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
232
|
+
<h4>
|
|
233
|
+
<span>position-height</span>
|
|
234
|
+
<span class="cocreate-badge success">string</span>
|
|
235
|
+
<span class="cocreate-badge warning">optional</span>
|
|
236
|
+
</h4>
|
|
237
|
+
<p>Height of position. Unit can be pixel or percent.</p>
|
|
238
|
+
</li>
|
|
239
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
240
|
+
<h4>
|
|
241
|
+
<span>position-color</span>
|
|
242
|
+
<span class="cocreate-badge success">color</span>
|
|
243
|
+
<span class="cocreate-badge warning">optional</span>
|
|
244
|
+
</h4>
|
|
245
|
+
<p>Color of position border.</p>
|
|
246
|
+
</li>
|
|
247
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
248
|
+
<h4>
|
|
249
|
+
<span>position-header</span>
|
|
250
|
+
<span class="cocreate-badge success">boolean</span>
|
|
251
|
+
<span class="cocreate-badge warning">optional</span>
|
|
252
|
+
</h4>
|
|
253
|
+
<p>Attribute whether to show header or not.</p>
|
|
254
|
+
</li>
|
|
255
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
256
|
+
<h4>
|
|
257
|
+
<span>position-x</span>
|
|
258
|
+
<span class="cocreate-badge success">string</span>
|
|
259
|
+
<span class="cocreate-badge warning">optional</span>
|
|
260
|
+
</h4>
|
|
261
|
+
<p>Position X of position.</p>
|
|
262
|
+
</li>
|
|
263
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
264
|
+
<h4>
|
|
265
|
+
<span>position-y</span>
|
|
266
|
+
<span class="cocreate-badge success">string</span>
|
|
267
|
+
<span class="cocreate-badge warning">optional</span>
|
|
268
|
+
</h4>
|
|
269
|
+
<p>Position Y of position.</p>
|
|
270
|
+
</li>
|
|
271
|
+
<li class="padding:15px_0px border-bottom:1px_solid_lightgrey">
|
|
272
|
+
<h4>
|
|
273
|
+
<span>open_in</span>
|
|
274
|
+
<span class="cocreate-badge success">string</span>
|
|
275
|
+
<span class="cocreate-badge warning">optional</span>
|
|
276
|
+
</h4>
|
|
277
|
+
<p>
|
|
278
|
+
Attribute where to show position in. "page" for current page.
|
|
279
|
+
"parent" for parent page. "root" for root page.
|
|
280
|
+
</p>
|
|
281
|
+
</li>
|
|
282
|
+
</ul>
|
|
283
|
+
</div>
|
|
332
284
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
285
|
+
<div
|
|
286
|
+
class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey"
|
|
287
|
+
>
|
|
288
|
+
<!-- SandBox -->
|
|
289
|
+
<div
|
|
290
|
+
id="position-demo"
|
|
291
|
+
class="border-bottom:1px_solid_lightgrey"
|
|
292
|
+
scroll
|
|
293
|
+
scroll-intersect="color:dodgerblue"
|
|
294
|
+
scroll-selector="#position-demo-section"
|
|
295
|
+
>
|
|
296
|
+
<span
|
|
297
|
+
class="display:flex align-items:center width:fit-content"
|
|
298
|
+
hover="display:block!important"
|
|
299
|
+
hover-selector="[href='#position-demo']"
|
|
300
|
+
>
|
|
301
|
+
<h2 class="padding:5px_0px">Demo</h2>
|
|
302
|
+
<a class="margin-left:10px display:none" href="#position-demo"
|
|
303
|
+
><i src="/assets/svg/link.svg"></i
|
|
304
|
+
></a>
|
|
305
|
+
</span>
|
|
306
|
+
</div>
|
|
307
|
+
<div class="position:sticky top:0 padding:15px_0px height:100vh">
|
|
308
|
+
<!-- SandBox -->
|
|
309
|
+
<div
|
|
310
|
+
class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
|
|
311
|
+
id="playground"
|
|
312
|
+
>
|
|
313
|
+
<div
|
|
314
|
+
id="demo-code"
|
|
315
|
+
resizable
|
|
316
|
+
class="position:relative height:50%"
|
|
317
|
+
>
|
|
318
|
+
<textarea
|
|
319
|
+
type="code"
|
|
320
|
+
lang="html"
|
|
321
|
+
array="demos"
|
|
322
|
+
object=""
|
|
323
|
+
key="demo"
|
|
324
|
+
save="false"
|
|
325
|
+
id="demo"
|
|
326
|
+
class="height:100% width:100% outline:none border:none resize:none padding:5px"
|
|
327
|
+
></textarea>
|
|
328
|
+
<div resize="bottom" class="background:lightgrey"></div>
|
|
329
|
+
</div>
|
|
377
330
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
331
|
+
<div
|
|
332
|
+
id="demo-preview"
|
|
333
|
+
class="position:relative overflow:auto background-color:white"
|
|
334
|
+
>
|
|
335
|
+
<div class="demopreview padding:20px"></div>
|
|
336
|
+
</div>
|
|
383
337
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
fullscreen-selector="#playground"></a>
|
|
428
|
-
</div>
|
|
429
|
-
</div>
|
|
430
|
-
<!-- End SandBox -->
|
|
431
|
-
</div>
|
|
432
|
-
</div>
|
|
338
|
+
<div
|
|
339
|
+
class="font-size:20px position:absolute top:10px right:10px opacity:0.6"
|
|
340
|
+
>
|
|
341
|
+
<a
|
|
342
|
+
class="margin-right:10px"
|
|
343
|
+
id="eye"
|
|
344
|
+
show="#eye-slash"
|
|
345
|
+
hide="#eye, #demo-preview"
|
|
346
|
+
toggle="code-height"
|
|
347
|
+
toggle-selector="#demo-code"
|
|
348
|
+
><i class="height:18px" src="/assets/svg/eye.svg"></i
|
|
349
|
+
></a>
|
|
350
|
+
<a
|
|
351
|
+
class="margin-right:10px"
|
|
352
|
+
hidden
|
|
353
|
+
id="eye-slash"
|
|
354
|
+
show="#eye, #demo-preview"
|
|
355
|
+
hide="#eye-slash"
|
|
356
|
+
toggle="code-height"
|
|
357
|
+
toggle-selector="#demo-code"
|
|
358
|
+
><i src="/assets/svg/eye-slash.svg"></i
|
|
359
|
+
></a>
|
|
360
|
+
<a
|
|
361
|
+
class="margin-right:10px"
|
|
362
|
+
id="code"
|
|
363
|
+
show="#code-slash"
|
|
364
|
+
hide="#code, #demo-code"
|
|
365
|
+
><i src="/assets/svg/code.svg"></i
|
|
366
|
+
></a>
|
|
367
|
+
<a
|
|
368
|
+
class="margin-right:10px"
|
|
369
|
+
hidden
|
|
370
|
+
id="code-slash"
|
|
371
|
+
show="#code, #demo-code"
|
|
372
|
+
hide="#code-slash"
|
|
373
|
+
><i class="height:18px" src="/assets/svg/code.svg"></i
|
|
374
|
+
></a>
|
|
375
|
+
<a
|
|
376
|
+
class="margin-right:5px"
|
|
377
|
+
fullscreen
|
|
378
|
+
fullscreen-selector="#playground"
|
|
379
|
+
></a>
|
|
380
|
+
</div>
|
|
433
381
|
</div>
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
382
|
+
<!-- End SandBox -->
|
|
383
|
+
</div>
|
|
384
|
+
</div>
|
|
385
|
+
</div>
|
|
386
|
+
<button
|
|
387
|
+
href="https://github.com/CoCreate-app/CoCreate-position/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
|
|
388
|
+
target="_blank"
|
|
389
|
+
class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)"
|
|
390
|
+
>
|
|
391
|
+
<i src="../assets/svg/pencil-alt.svg"></i>
|
|
392
|
+
</button>
|
|
393
|
+
</main>
|
|
441
394
|
|
|
442
|
-
|
|
443
|
-
|
|
395
|
+
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
|
|
396
|
+
</body>
|
|
444
397
|
</html>
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import observer from '@cocreate/observer';
|
|
|
2
2
|
import position from './position'
|
|
3
3
|
import './index.css'
|
|
4
4
|
|
|
5
|
-
function init(){
|
|
5
|
+
function init() {
|
|
6
6
|
let elements = document.querySelectorAll('[moveable], [positionable]');
|
|
7
7
|
initElements(elements)
|
|
8
8
|
}
|
|
@@ -11,27 +11,27 @@ function initElements(elements) {
|
|
|
11
11
|
for (let element of elements)
|
|
12
12
|
initElement(element)
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
function initElement(element) {
|
|
16
|
-
|
|
16
|
+
element.position = new position(element, element.parentElement);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
observer.init({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
name: "positionAddedNodes",
|
|
21
|
+
observe: ['addedNodes'],
|
|
22
|
+
selector: '[moveable], [positionable]',
|
|
23
|
+
callback: mutation => {
|
|
24
|
+
initElement(mutation.target);
|
|
25
|
+
}
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
observer.init({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
name: "positionAttributes",
|
|
30
|
+
observe: ['attributes'],
|
|
31
|
+
attributeName: ['moveable', 'positionable'],
|
|
32
|
+
callback: mutation => {
|
|
33
|
+
initElement(mutation.target);
|
|
34
|
+
}
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
init()
|