@textbus/xnote 0.0.1-alpha.28 → 0.0.1-alpha.29
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/bundles/index.esm.js +9 -4
- package/bundles/index.js +9 -4
- package/package.json +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -2366,7 +2366,8 @@ function ListComponentView(props) {
|
|
|
2366
2366
|
return () => {
|
|
2367
2367
|
const ListType = component.state.type === 'UnorderedList' ? 'ul' : 'ol';
|
|
2368
2368
|
const ulIcons = ['•', '◦', '▪'];
|
|
2369
|
-
let icon
|
|
2369
|
+
let icon;
|
|
2370
|
+
let listStep = 0;
|
|
2370
2371
|
const indent = component.state.slot.getAttribute(textIndentAttr) || 0;
|
|
2371
2372
|
if (ListType === 'ul') {
|
|
2372
2373
|
icon = ulIcons[indent % 3];
|
|
@@ -2374,7 +2375,6 @@ function ListComponentView(props) {
|
|
|
2374
2375
|
else {
|
|
2375
2376
|
const parentSlot = component.parent;
|
|
2376
2377
|
const index = parentSlot.indexOf(component);
|
|
2377
|
-
let listStep = 0;
|
|
2378
2378
|
if (!component.state.reorder) {
|
|
2379
2379
|
const beforeContent = parentSlot.sliceContent(0, index);
|
|
2380
2380
|
while (beforeContent.length) {
|
|
@@ -2405,7 +2405,7 @@ function ListComponentView(props) {
|
|
|
2405
2405
|
icon = numberToLetter(listStep) + '.';
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
return (jsx(ListType, { ref: props.rootRef, "data-component": component.name, class: "xnote-list", style: {
|
|
2408
|
+
return (jsx(ListType, { ref: props.rootRef, "data-component": component.name, "data-reorder": listStep === 0, class: "xnote-list", style: {
|
|
2409
2409
|
marginLeft: indent * 24 + 'px'
|
|
2410
2410
|
}, children: jsxs("li", { style: {
|
|
2411
2411
|
justifyContent: align[component.state.slot.getAttribute(textAlignAttr)],
|
|
@@ -2433,7 +2433,7 @@ const listComponentLoader = {
|
|
|
2433
2433
|
]), element.querySelector('.xnote-list-content') || document.createElement('div'));
|
|
2434
2434
|
return new ListComponent(textbus, {
|
|
2435
2435
|
slot,
|
|
2436
|
-
reorder:
|
|
2436
|
+
reorder: element.dataset.reorder !== 'false',
|
|
2437
2437
|
type
|
|
2438
2438
|
});
|
|
2439
2439
|
}
|
|
@@ -4197,6 +4197,11 @@ function LinkJump() {
|
|
|
4197
4197
|
top: rect.top - offsetRect.top + 'px'
|
|
4198
4198
|
});
|
|
4199
4199
|
isShow.set(true);
|
|
4200
|
+
let url = queryState.value.href;
|
|
4201
|
+
if (url.indexOf('://') < 0) {
|
|
4202
|
+
url = 'http://' + url;
|
|
4203
|
+
}
|
|
4204
|
+
href.set(url);
|
|
4200
4205
|
return;
|
|
4201
4206
|
}
|
|
4202
4207
|
}
|
package/bundles/index.js
CHANGED
|
@@ -2368,7 +2368,8 @@ function ListComponentView(props) {
|
|
|
2368
2368
|
return () => {
|
|
2369
2369
|
const ListType = component.state.type === 'UnorderedList' ? 'ul' : 'ol';
|
|
2370
2370
|
const ulIcons = ['•', '◦', '▪'];
|
|
2371
|
-
let icon
|
|
2371
|
+
let icon;
|
|
2372
|
+
let listStep = 0;
|
|
2372
2373
|
const indent = component.state.slot.getAttribute(textIndentAttr) || 0;
|
|
2373
2374
|
if (ListType === 'ul') {
|
|
2374
2375
|
icon = ulIcons[indent % 3];
|
|
@@ -2376,7 +2377,6 @@ function ListComponentView(props) {
|
|
|
2376
2377
|
else {
|
|
2377
2378
|
const parentSlot = component.parent;
|
|
2378
2379
|
const index = parentSlot.indexOf(component);
|
|
2379
|
-
let listStep = 0;
|
|
2380
2380
|
if (!component.state.reorder) {
|
|
2381
2381
|
const beforeContent = parentSlot.sliceContent(0, index);
|
|
2382
2382
|
while (beforeContent.length) {
|
|
@@ -2407,7 +2407,7 @@ function ListComponentView(props) {
|
|
|
2407
2407
|
icon = numberToLetter(listStep) + '.';
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
|
-
return (jsxRuntime.jsx(ListType, { ref: props.rootRef, "data-component": component.name, class: "xnote-list", style: {
|
|
2410
|
+
return (jsxRuntime.jsx(ListType, { ref: props.rootRef, "data-component": component.name, "data-reorder": listStep === 0, class: "xnote-list", style: {
|
|
2411
2411
|
marginLeft: indent * 24 + 'px'
|
|
2412
2412
|
}, children: jsxRuntime.jsxs("li", { style: {
|
|
2413
2413
|
justifyContent: align[component.state.slot.getAttribute(textAlignAttr)],
|
|
@@ -2435,7 +2435,7 @@ const listComponentLoader = {
|
|
|
2435
2435
|
]), element.querySelector('.xnote-list-content') || document.createElement('div'));
|
|
2436
2436
|
return new ListComponent(textbus, {
|
|
2437
2437
|
slot,
|
|
2438
|
-
reorder:
|
|
2438
|
+
reorder: element.dataset.reorder !== 'false',
|
|
2439
2439
|
type
|
|
2440
2440
|
});
|
|
2441
2441
|
}
|
|
@@ -4199,6 +4199,11 @@ function LinkJump() {
|
|
|
4199
4199
|
top: rect.top - offsetRect.top + 'px'
|
|
4200
4200
|
});
|
|
4201
4201
|
isShow.set(true);
|
|
4202
|
+
let url = queryState.value.href;
|
|
4203
|
+
if (url.indexOf('://') < 0) {
|
|
4204
|
+
url = 'http://' + url;
|
|
4205
|
+
}
|
|
4206
|
+
href.set(url);
|
|
4202
4207
|
return;
|
|
4203
4208
|
}
|
|
4204
4209
|
}
|
package/package.json
CHANGED