ziko 0.0.24 → 0.0.26
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/README.md +1 -1
- package/dist/ziko.cjs +50 -8
- package/dist/ziko.js +53 -11
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +53 -11
- package/package.json +1 -1
- package/src/data/parser/index.js +1 -1
- package/src/reactivity/events/click.js +43 -1
- package/src/ui/elements/ZikoUIElement.js +6 -6
- package/src/ui/elements/text/__ZikoUIText__.js +3 -3
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/arc.js +0 -43
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/image.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/line.js +0 -26
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/path.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/points.js +0 -48
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/polygon.js +0 -7
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/polyline.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/rect.js +0 -46
- package/src/graphics/canvas/elements ( To Be Moved )/Basic/text.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Chart/histogram.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Chart/plot.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Chart/scatter.js +0 -2
- package/src/graphics/canvas/elements ( To Be Moved )/Chart/stem.js +0 -0
- package/src/graphics/canvas/elements ( To Be Moved )/Element.js +0 -115
- package/src/graphics/canvas/elements ( To Be Moved )/index.js +0 -13
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/circle.js +0 -29
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/ellipse.js +0 -24
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/foreign-object.js +0 -36
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/groupe.js +0 -32
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/image.js +0 -36
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/index.js +0 -11
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/line.js +0 -32
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/link.js +0 -33
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/path.js +0 -62
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/polygon.js +0 -32
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/polyline.js +0 -7
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/rect.js +0 -46
- package/src/graphics/svg/Elements ( To Be Moved )/Basic/text.js +0 -29
- package/src/graphics/svg/Elements ( To Be Moved )/Derived/grid.js +0 -9
- package/src/graphics/svg/Elements ( To Be Moved )/Derived/index.js +0 -1
- package/src/graphics/svg/Elements ( To Be Moved )/index.js +0 -2
- package/src/graphics/svg/Elements ( To Be Moved )/ziko-svg-element.js +0 -48
- package/src/ui/elements/derived ( To Be Moved)/accordion/accordion.js +0 -42
- package/src/ui/elements/derived ( To Be Moved)/accordion/collapsible.js +0 -82
- package/src/ui/elements/derived ( To Be Moved)/accordion/index.js +0 -2
- package/src/ui/elements/derived ( To Be Moved)/alert/alert.js +0 -80
- package/src/ui/elements/derived ( To Be Moved)/alert/index.js +0 -1
- package/src/ui/elements/derived ( To Be Moved)/alert/palette.js +0 -52
- package/src/ui/elements/derived ( To Be Moved)/carousel/index.js +0 -51
- package/src/ui/elements/derived ( To Be Moved)/code-note/SubElements.js.txt +0 -105
- package/src/ui/elements/derived ( To Be Moved)/code-note/code-cell.js +0 -195
- package/src/ui/elements/derived ( To Be Moved)/code-note/code-note.js +0 -72
- package/src/ui/elements/derived ( To Be Moved)/code-note/index.js +0 -2
- package/src/ui/elements/derived ( To Be Moved)/code-note/sub-elements.js +0 -67
- package/src/ui/elements/derived ( To Be Moved)/index.js +0 -12
- package/src/ui/elements/derived ( To Be Moved)/menu/index.js +0 -1
- package/src/ui/elements/derived ( To Be Moved)/menu/menu3d.js +0 -260
- package/src/ui/elements/derived ( To Be Moved)/modal/index.js +0 -92
- package/src/ui/elements/derived ( To Be Moved)/pagination/breadcrumbs.js +0 -54
- package/src/ui/elements/derived ( To Be Moved)/pagination/index.js +0 -1
- package/src/ui/elements/derived ( To Be Moved)/slider/__ZikoUISlider__.js +0 -112
- package/src/ui/elements/derived ( To Be Moved)/slider/hSlider.js +0 -34
- package/src/ui/elements/derived ( To Be Moved)/slider/index.js +0 -12
- package/src/ui/elements/derived ( To Be Moved)/slider/vSlider.js +0 -27
- package/src/ui/elements/derived ( To Be Moved)/splitter/__ZikoUISplitter__.js +0 -62
- package/src/ui/elements/derived ( To Be Moved)/splitter/hsplitter.js +0 -40
- package/src/ui/elements/derived ( To Be Moved)/splitter/index.js +0 -12
- package/src/ui/elements/derived ( To Be Moved)/splitter/vsplitter.js +0 -40
- package/src/ui/elements/derived ( To Be Moved)/tabs/index.js +0 -180
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/dark.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/light.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/app/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/component/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/globals/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/params/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/router/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/seo/index.js +0 -0
- /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/style/index.js +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ZikoUIFlex } from "../Flex";
|
|
2
|
-
import { Section } from "../../primitives/semantic";
|
|
3
|
-
class ZikoUICarousel extends ZikoUIFlex{
|
|
4
|
-
constructor(...ZikoUIElement){
|
|
5
|
-
super()
|
|
6
|
-
this.style({
|
|
7
|
-
position:"relative",
|
|
8
|
-
overflow:"hidden",
|
|
9
|
-
touchAction:"none",
|
|
10
|
-
userSelect:"none"
|
|
11
|
-
});
|
|
12
|
-
this.horizontal("space-around",0);
|
|
13
|
-
this.track = Section(...ZikoUIElement).style({ display: "inline-flex" });
|
|
14
|
-
this.track.size(this.track.children.length * 100 + "vw");
|
|
15
|
-
this.track.setTarget(this);
|
|
16
|
-
this.track.items.map((n) =>
|
|
17
|
-
n.style({ pointerEvents: "none", margin: "auto 10px" })
|
|
18
|
-
);
|
|
19
|
-
this.x0 = null;
|
|
20
|
-
this.tx = 0;
|
|
21
|
-
this.onPtrMove(e=>{
|
|
22
|
-
if(e.isDown){
|
|
23
|
-
let x = e.event.pageX;
|
|
24
|
-
let dx = x - this.x0;
|
|
25
|
-
this.track.st.translateX(
|
|
26
|
-
this.tx + dx,
|
|
27
|
-
0
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
this.onPtrDown(e=>{
|
|
32
|
-
console.log(e.event)
|
|
33
|
-
this.x0 = e.event.pageX;
|
|
34
|
-
const transformMatrix = window
|
|
35
|
-
.getComputedStyle(this.track.element)
|
|
36
|
-
.getPropertyValue("transform");
|
|
37
|
-
if (transformMatrix !== "none") {
|
|
38
|
-
this.tx = +transformMatrix.split(",")[4];
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
this.onPtrUp(e=>console.log(e.isDown));
|
|
42
|
-
this.onPtrLeave(e=>{
|
|
43
|
-
// Handle outside up
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
get isCarousel(){
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const Carousel=(...ZikoUIElement)=>new ZikoUICarousel(...ZikoUIElement);
|
|
51
|
-
export {Carousel}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { html } from "../../../Misc";
|
|
2
|
-
import { Flex } from "../../Flex";
|
|
3
|
-
import { text } from "../../../Text";
|
|
4
|
-
import { ZikoUICodeNote } from "./CodeNote";
|
|
5
|
-
import {EditorView, basicSetup} from "codemirror"
|
|
6
|
-
import {javascript} from "@codemirror/lang-javascript"
|
|
7
|
-
import {keymap} from "@codemirror/view"
|
|
8
|
-
import {indentWithTab} from "@codemirror/commands"
|
|
9
|
-
import { style } from "../../../Utils";
|
|
10
|
-
|
|
11
|
-
// const Input=(codeText="")=>html("code",codeText).style({
|
|
12
|
-
// width:"100%",
|
|
13
|
-
// height:"auto",
|
|
14
|
-
// padding:"10px",
|
|
15
|
-
// boxSizing:"border-box",
|
|
16
|
-
// border: "1px solid #ccc",
|
|
17
|
-
// outline: "none",
|
|
18
|
-
// fontSize: "1rem",
|
|
19
|
-
// fontFamily: "Lucida Console, Courier New, monospace",
|
|
20
|
-
// padding: "1rem 0.5rem",
|
|
21
|
-
// wordBreak:"break-all",
|
|
22
|
-
// background:"#f6f8fa",
|
|
23
|
-
// color:"#0062C3"
|
|
24
|
-
// }).setAttr("contenteditable",true).setAttr("spellcheck",false);
|
|
25
|
-
|
|
26
|
-
const Input = (codeText = "") => {
|
|
27
|
-
// Create the code element with styles
|
|
28
|
-
const inputElement = html("code", codeText)
|
|
29
|
-
.style({
|
|
30
|
-
// width: "100%",
|
|
31
|
-
// height: "auto",
|
|
32
|
-
// padding: "10px",
|
|
33
|
-
// boxSizing: "border-box",
|
|
34
|
-
// border: "1px solid #ccc",
|
|
35
|
-
outline: "none",
|
|
36
|
-
fontSize: "1rem",
|
|
37
|
-
fontFamily: "Lucida Console, Courier New, monospace",
|
|
38
|
-
// padding: "1rem 0.5rem",
|
|
39
|
-
// wordBreak: "break-all",
|
|
40
|
-
// background: "#f6f8fa",
|
|
41
|
-
// color: "#0062C3",
|
|
42
|
-
})
|
|
43
|
-
// .setAttr("contenteditable", true).setAttr("spellcheck", false);
|
|
44
|
-
|
|
45
|
-
// Initialize CodeMirror editor view on the created element
|
|
46
|
-
let editor=new EditorView({
|
|
47
|
-
extensions: [
|
|
48
|
-
basicSetup,
|
|
49
|
-
javascript(),
|
|
50
|
-
keymap.of([indentWithTab])
|
|
51
|
-
],
|
|
52
|
-
parent: inputElement.element // Use the element for CodeMirror's parent
|
|
53
|
-
});
|
|
54
|
-
window.editor = editor
|
|
55
|
-
// Return the element to be used elsewhere
|
|
56
|
-
return inputElement;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const Output=()=>html("output").style({
|
|
61
|
-
width:"100%",
|
|
62
|
-
height:"auto",
|
|
63
|
-
padding:"5px 0",
|
|
64
|
-
})
|
|
65
|
-
const Left=(ctx)=>Flex(
|
|
66
|
-
text("[ ]")
|
|
67
|
-
).style({
|
|
68
|
-
width:"50px",
|
|
69
|
-
//height:getComputedStyle(ctx.Input.element).height,
|
|
70
|
-
height:"50px",
|
|
71
|
-
margin:"10px 4px",
|
|
72
|
-
padding:"5px",
|
|
73
|
-
color:"darkblue",
|
|
74
|
-
borderBottom:"4px solid gold",
|
|
75
|
-
}).horizontal(0,0);
|
|
76
|
-
const BTN_STYLE={
|
|
77
|
-
background:"none",
|
|
78
|
-
width:"25px",
|
|
79
|
-
height:"25px",
|
|
80
|
-
fontSize:"1.2rem",
|
|
81
|
-
cursor:"pointer"
|
|
82
|
-
}
|
|
83
|
-
const Right=(ctx)=>Flex(
|
|
84
|
-
text('▶️').style(BTN_STYLE).onClick(e=>{
|
|
85
|
-
if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
|
|
86
|
-
ctx.execute();
|
|
87
|
-
globalThis.__Ziko__.__Config__.default.target=e.target.parent.parent[1][1];
|
|
88
|
-
}),
|
|
89
|
-
text('📋').style(BTN_STYLE).onClick(()=>{
|
|
90
|
-
navigator.clipboard.writeText(ctx.codeText)
|
|
91
|
-
}),
|
|
92
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
93
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
94
|
-
).style({
|
|
95
|
-
width:"70px",
|
|
96
|
-
height:"50px",
|
|
97
|
-
//background:"cyan",
|
|
98
|
-
margin:"10px 0"
|
|
99
|
-
}).horizontal(0,0).wrap(true);
|
|
100
|
-
export{
|
|
101
|
-
Input,
|
|
102
|
-
Output,
|
|
103
|
-
Right,
|
|
104
|
-
Left
|
|
105
|
-
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { Flex, ZikoUIFlex } from "../Flex";
|
|
2
|
-
import { ZikoUICodeNote } from "./code-note";
|
|
3
|
-
import {
|
|
4
|
-
Input,
|
|
5
|
-
Output,
|
|
6
|
-
Right,
|
|
7
|
-
Left
|
|
8
|
-
} from "./sub-elements";
|
|
9
|
-
class ZikoUICodeCell extends ZikoUIFlex{
|
|
10
|
-
constructor(code="",{type="js",order=null}={}){
|
|
11
|
-
super("section")
|
|
12
|
-
Object.assign(this.cache,{
|
|
13
|
-
state:null,
|
|
14
|
-
order,
|
|
15
|
-
type,
|
|
16
|
-
metadata:{
|
|
17
|
-
created:Date.now(),
|
|
18
|
-
updated:null
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
this.Input=Input(code);
|
|
22
|
-
this.Output=Output();
|
|
23
|
-
this.InOut=Flex(
|
|
24
|
-
this.Input,
|
|
25
|
-
this.Output
|
|
26
|
-
).vertical().style({
|
|
27
|
-
width:"100%",
|
|
28
|
-
margin:"10px auto"
|
|
29
|
-
});
|
|
30
|
-
this.RightControl=Right(this);
|
|
31
|
-
this.LeftControl=Left(this)
|
|
32
|
-
this.append(
|
|
33
|
-
this.LeftControl,
|
|
34
|
-
this.InOut,
|
|
35
|
-
this.RightControl
|
|
36
|
-
)
|
|
37
|
-
this.horizontal(-1,1).style({
|
|
38
|
-
//background:"#444",
|
|
39
|
-
width:"95vw",
|
|
40
|
-
margin:"0 auto",
|
|
41
|
-
border:"1px darkblue dotted"
|
|
42
|
-
})
|
|
43
|
-
let cm_content = this.Input.element.getElementsByClassName("cm-content")[0];
|
|
44
|
-
if( cm_content ){
|
|
45
|
-
cm_content.addEventListener("keydown",e=>{
|
|
46
|
-
if(e.key === "Enter" && e.shiftKey){
|
|
47
|
-
e.preventDefault();
|
|
48
|
-
this.execute(this.cache.order);
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
else{
|
|
53
|
-
this.Input.onKeyDown(e=>{
|
|
54
|
-
if(e.kd==="Enter"){
|
|
55
|
-
if(e.event.shiftKey){
|
|
56
|
-
e.event.preventDefault();
|
|
57
|
-
this.execute(this.cache.order);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
//console.log(this.Input.element.firstChild.firstChild.textContent.at(-1))
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
64
|
-
if(e.kd==="ArrowDown" && e.event.shiftKey ){
|
|
65
|
-
this.cache.parent.next();
|
|
66
|
-
}
|
|
67
|
-
if(e.kd==="ArrowUp" && e.event.shiftKey){
|
|
68
|
-
this.cache.parent.previous();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
this.Input.onFocus(()=>{
|
|
74
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
75
|
-
this.cache.parent.cache.currentNote=this;
|
|
76
|
-
this.cache.parent.setCurrentNote(this);
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
this.Input.onPaste((e)=>{
|
|
80
|
-
//e.event.preventDefault();
|
|
81
|
-
//this.setValue(this.codeText.trim())
|
|
82
|
-
})
|
|
83
|
-
// this.Input.onKeyPress(e=>{
|
|
84
|
-
// if(e.kp==="(")a.Input.element.textContent+=")";
|
|
85
|
-
// if(e.kp==="[")a.Input.element.textContent+="]";
|
|
86
|
-
// if(e.kp==="{")a.Input.element.textContent+="}";
|
|
87
|
-
// })
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
get isCodeCell(){
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
// space  
|
|
94
|
-
get codeText() {
|
|
95
|
-
return (this.Input.element.getElementsByClassName("cm-content")[0])
|
|
96
|
-
?this.Input.element.getElementsByClassName("cm-content")[0].innerText.trim()
|
|
97
|
-
:this.Input.element.innerText.trim()
|
|
98
|
-
// return this.Input.element.innerText.trim();
|
|
99
|
-
}
|
|
100
|
-
get codeHTML() {
|
|
101
|
-
return this.Input.element.innerHTML;
|
|
102
|
-
}
|
|
103
|
-
get outputHTML(){
|
|
104
|
-
return this.Output.element.innerHTML;
|
|
105
|
-
}
|
|
106
|
-
setValue(codeText){
|
|
107
|
-
this.Input[0].setValue(codeText);
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
cellData(){
|
|
111
|
-
return {
|
|
112
|
-
input:this.codeText,
|
|
113
|
-
output:this.outputHTML,
|
|
114
|
-
order:this.cache.order,
|
|
115
|
-
type:this.cache.type
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
execute(order){
|
|
119
|
-
this.clearOutput();
|
|
120
|
-
this.evaluate(order);
|
|
121
|
-
this.cache.metadata.updated=Date.now();
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
|
-
#evaluateJs(order){
|
|
125
|
-
try{
|
|
126
|
-
this.LeftControl[0].setValue("pending");
|
|
127
|
-
this.cache.state="pending";
|
|
128
|
-
// globalThis.eval(this.Input.element.innerText);
|
|
129
|
-
globalThis.eval(this.codeText);
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
catch(err){
|
|
133
|
-
console.log(err)
|
|
134
|
-
text(`Error : ${err.message}`).style({
|
|
135
|
-
color:"red",
|
|
136
|
-
background:"gold",
|
|
137
|
-
border:"2px red solid",
|
|
138
|
-
padding:"10px",
|
|
139
|
-
margin:"10px 0",
|
|
140
|
-
display:"flex",
|
|
141
|
-
justifyContent: "center",
|
|
142
|
-
});
|
|
143
|
-
this.LeftControl[0].setValue("Err");
|
|
144
|
-
this.cache.state="Error";
|
|
145
|
-
}
|
|
146
|
-
finally{
|
|
147
|
-
if(this.cache.state==="pending"){
|
|
148
|
-
this.cache.state="success";
|
|
149
|
-
this.setOrder(order);
|
|
150
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
151
|
-
this.cache.parent.incrementOrder();
|
|
152
|
-
this.cache.parent.next();
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
#evaluateMd(){
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
#evaluateHtml(){
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
evaluate(order){
|
|
164
|
-
globalThis.__Ziko__.__Config__.default.target=this.Output.element;
|
|
165
|
-
switch(this.cache.type){
|
|
166
|
-
case "js":this.#evaluateJs(order);break;
|
|
167
|
-
}
|
|
168
|
-
return this;
|
|
169
|
-
}
|
|
170
|
-
clearInput(){
|
|
171
|
-
this.Output.element.innerText="";
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
clearOutput(){
|
|
175
|
-
this.Output.element.innerText="";
|
|
176
|
-
return this;
|
|
177
|
-
}
|
|
178
|
-
setOrder(order,render=true){
|
|
179
|
-
this.cache.order=order;
|
|
180
|
-
if(render){
|
|
181
|
-
(typeof order === "number")?this.LeftControl[0].setValue(`[${order}]`):this.LeftControl[0].setValue("[-]");
|
|
182
|
-
}
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
focus(){
|
|
186
|
-
this.Input.element.focus();
|
|
187
|
-
return this;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const CodeCell=(codeText,{type,order}={})=>new ZikoUICodeCell(codeText,{type,order});
|
|
193
|
-
export{
|
|
194
|
-
CodeCell
|
|
195
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ZikoUIFlex } from "../Flex";
|
|
2
|
-
import { CodeCell } from "./code-cell";
|
|
3
|
-
class ZikoUICodeNote extends ZikoUIFlex{
|
|
4
|
-
constructor(){
|
|
5
|
-
super("section");
|
|
6
|
-
Object.assign(this.cache,{
|
|
7
|
-
order:0,
|
|
8
|
-
currentNote:null,
|
|
9
|
-
currentNoteIndex:null
|
|
10
|
-
})
|
|
11
|
-
this.vertical(0,0);
|
|
12
|
-
}
|
|
13
|
-
get isCodeNote(){
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
setCurrentNote(currentNote){
|
|
17
|
-
this.cache.currentNote=currentNote;
|
|
18
|
-
this.cache.currentNoteIndex=this.items.findIndex(n=>n===currentNote);
|
|
19
|
-
currentNote.focus();
|
|
20
|
-
this.items.forEach(n=>n.Input.style({
|
|
21
|
-
border: "1px solid #ccc"
|
|
22
|
-
}))
|
|
23
|
-
currentNote.Input.style({
|
|
24
|
-
border:"2px lightgreen solid"
|
|
25
|
-
});
|
|
26
|
-
return this;
|
|
27
|
-
}
|
|
28
|
-
addNote(text=""){
|
|
29
|
-
this.append(CodeCell(text));
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
execute(){
|
|
33
|
-
this.cache.currentNote.execute();
|
|
34
|
-
this.incrementOrder();
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
incrementOrder(){
|
|
38
|
-
this.cache.order++;
|
|
39
|
-
this.cache.currentNote.setOrder(this.cache.order);
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
next(){
|
|
43
|
-
if(this.cache.currentNote===this.items.at(-1)){
|
|
44
|
-
this.addNote();
|
|
45
|
-
this.setCurrentNote(this.items.at(-1));
|
|
46
|
-
}
|
|
47
|
-
else this.setCurrentNote(this.items[this.cache.currentNoteIndex+1]);
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
previous(){
|
|
51
|
-
// add append before
|
|
52
|
-
if(this.cache.currentNote!==this.items[0]){
|
|
53
|
-
this.setCurrentNote(this.items[this.cache.currentNoteIndex-1]);
|
|
54
|
-
}
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
data(){
|
|
58
|
-
return this.items.map(n=>n.cellData());
|
|
59
|
-
}
|
|
60
|
-
serialize(){
|
|
61
|
-
return JSON.stringify(this.data());
|
|
62
|
-
}
|
|
63
|
-
import(data=[]){
|
|
64
|
-
data.forEach((n,i)=>this.addNote(data[i].input));
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const CodeNote=()=>new ZikoUICodeNote();
|
|
69
|
-
export{
|
|
70
|
-
CodeNote,
|
|
71
|
-
ZikoUICodeNote
|
|
72
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { html } from "../../primitives/misc/index.js";
|
|
2
|
-
import { Flex } from "../flex";
|
|
3
|
-
import { text } from "../../primitives/text/index.js";
|
|
4
|
-
import { ZikoUICodeNote } from "./code-note.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Input=(codeText="")=>html("code",codeText).style({
|
|
8
|
-
width:"100%",
|
|
9
|
-
height:"auto",
|
|
10
|
-
padding:"10px",
|
|
11
|
-
boxSizing:"border-box",
|
|
12
|
-
border: "1px solid #ccc",
|
|
13
|
-
outline: "none",
|
|
14
|
-
fontSize: "1rem",
|
|
15
|
-
fontFamily: "Lucida Console, Courier New, monospace",
|
|
16
|
-
padding: "1rem 0.5rem",
|
|
17
|
-
wordBreak:"break-all",
|
|
18
|
-
background:"#f6f8fa",
|
|
19
|
-
color:"#0062C3"
|
|
20
|
-
}).setAttr("contenteditable",true).setAttr("spellcheck",false);
|
|
21
|
-
|
|
22
|
-
const Output=()=>html("output").style({
|
|
23
|
-
width:"100%",
|
|
24
|
-
height:"auto",
|
|
25
|
-
padding:"5px 0",
|
|
26
|
-
})
|
|
27
|
-
const Left=(ctx)=>Flex(
|
|
28
|
-
text("[ ]")
|
|
29
|
-
).style({
|
|
30
|
-
width:"50px",
|
|
31
|
-
//height:getComputedStyle(ctx.Input.element).height,
|
|
32
|
-
height:"50px",
|
|
33
|
-
margin:"10px 4px",
|
|
34
|
-
padding:"5px",
|
|
35
|
-
color:"darkblue",
|
|
36
|
-
borderBottom:"4px solid gold",
|
|
37
|
-
}).horizontal(0,0);
|
|
38
|
-
const BTN_STYLE={
|
|
39
|
-
background:"none",
|
|
40
|
-
width:"25px",
|
|
41
|
-
height:"25px",
|
|
42
|
-
fontSize:"1.2rem",
|
|
43
|
-
cursor:"pointer"
|
|
44
|
-
}
|
|
45
|
-
const Right=(ctx)=>Flex(
|
|
46
|
-
text('▶️').style(BTN_STYLE).onClick(e=>{
|
|
47
|
-
if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
|
|
48
|
-
ctx.execute();
|
|
49
|
-
globalThis.__Ziko__.__Config__.default.target=e.target.parent.parent[1][1];
|
|
50
|
-
}),
|
|
51
|
-
text('📋').style(BTN_STYLE).onClick(()=>{
|
|
52
|
-
navigator.clipboard.writeText(ctx.codeText)
|
|
53
|
-
}),
|
|
54
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
55
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
56
|
-
).style({
|
|
57
|
-
width:"70px",
|
|
58
|
-
height:"50px",
|
|
59
|
-
//background:"cyan",
|
|
60
|
-
margin:"10px 0"
|
|
61
|
-
}).horizontal(0,0).wrap(true);
|
|
62
|
-
export{
|
|
63
|
-
Input,
|
|
64
|
-
Output,
|
|
65
|
-
Right,
|
|
66
|
-
Left
|
|
67
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./flex";
|
|
2
|
-
export * from "./grid";
|
|
3
|
-
// export * from "./accordion";
|
|
4
|
-
// export * from "./carousel";
|
|
5
|
-
// export * from "./code-note";
|
|
6
|
-
// export * from "./tabs";
|
|
7
|
-
// export * from "./alert";
|
|
8
|
-
// export * from "./splitter";
|
|
9
|
-
// export * from "./pagination";
|
|
10
|
-
// export * from "./menu";
|
|
11
|
-
// export * from "./modal"
|
|
12
|
-
// export * from "./slider"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./menu3d.js"
|