taraskevizer 10.2.9 → 10.3.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/dist/bin.js
CHANGED
|
@@ -7,7 +7,7 @@ process.argv.splice(0, 2);
|
|
|
7
7
|
const firstArg = process.argv[0];
|
|
8
8
|
if (firstArg) {
|
|
9
9
|
if (firstArg === '-v' || firstArg === '--version') {
|
|
10
|
-
printWithPrefix("10.
|
|
10
|
+
printWithPrefix("10.3.0");
|
|
11
11
|
process.exit(0);
|
|
12
12
|
}
|
|
13
13
|
if (firstArg === '-h' || firstArg === '--help') {
|
|
@@ -2,15 +2,8 @@ import type { Wrappers } from './wrappers';
|
|
|
2
2
|
type ChangeableElement = HTMLElement & {
|
|
3
3
|
seqNum: number;
|
|
4
4
|
};
|
|
5
|
-
type NodeList<T extends Node> = T[] | NodeListOf<T>;
|
|
6
5
|
export declare const createInteractiveTags: ({ variable, letterH }?: Omit<Record<keyof Wrappers, string>, "fix">) => {
|
|
7
6
|
update: (root: Element) => void;
|
|
8
7
|
tryAlternate: (el: Element | ChangeableElement) => void;
|
|
9
8
|
};
|
|
10
|
-
export declare const apply: (elems: NodeList<ChangeableElement>) => void;
|
|
11
|
-
/**
|
|
12
|
-
* @param el non-changeable elements are ignored
|
|
13
|
-
* @deprecated
|
|
14
|
-
**/
|
|
15
|
-
export declare const tryAlternate: (el: Element | ChangeableElement) => void;
|
|
16
9
|
export {};
|
|
@@ -80,73 +80,3 @@ export const createInteractiveTags = ({ variable, letterH } = {
|
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
|
-
const changeList = [];
|
|
84
|
-
|
|
85
|
-
export const apply = (elems) => {
|
|
86
|
-
if (changeList.length > elems.length) {
|
|
87
|
-
changeList.length = elems.length;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
while (changeList.length < elems.length) {
|
|
91
|
-
changeList.push(0);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
for (let i = 0; i < changeList.length; i++) {
|
|
95
|
-
const el = elems[i];
|
|
96
|
-
el.seqNum = i;
|
|
97
|
-
if (changeList[i]) {
|
|
98
|
-
switch (el.tagName) {
|
|
99
|
-
case 'TARH':
|
|
100
|
-
{
|
|
101
|
-
applyG(el);
|
|
102
|
-
}
|
|
103
|
-
break;
|
|
104
|
-
case 'TARL': {
|
|
105
|
-
let data = el.dataset.l;
|
|
106
|
-
if (data.includes(',')) {
|
|
107
|
-
const dataArr = data.split(',');
|
|
108
|
-
data = el.innerHTML;
|
|
109
|
-
for (let j = 0; j < changeList[i]; ++j) {
|
|
110
|
-
dataArr.push(data);
|
|
111
|
-
data = dataArr.shift();
|
|
112
|
-
}
|
|
113
|
-
el.dataset.l = dataArr.join(',');
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
el.dataset.l = el.innerHTML;
|
|
117
|
-
}
|
|
118
|
-
el.innerHTML = data;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const tryAlternate = (el) => {
|
|
126
|
-
if ('seqNum' in el) {
|
|
127
|
-
switch (el.tagName) {
|
|
128
|
-
case 'TARH':
|
|
129
|
-
{
|
|
130
|
-
changeList[el.seqNum] = changeList[el.seqNum] ? 0 : 1;
|
|
131
|
-
applyG(el);
|
|
132
|
-
}
|
|
133
|
-
break;
|
|
134
|
-
case 'TARL': {
|
|
135
|
-
let data = el.dataset.l;
|
|
136
|
-
if (data.includes(',')) {
|
|
137
|
-
const dataArr = data.split(',');
|
|
138
|
-
dataArr.push(el.innerHTML);
|
|
139
|
-
data = dataArr.shift();
|
|
140
|
-
changeList[el.seqNum] =
|
|
141
|
-
(changeList[el.seqNum] + 1) % (dataArr.length + 1);
|
|
142
|
-
el.dataset.l = dataArr.join(',');
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
changeList[el.seqNum] = changeList[el.seqNum] ? 0 : 1;
|
|
146
|
-
el.dataset.l = el.innerHTML;
|
|
147
|
-
}
|
|
148
|
-
el.innerHTML = data;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|