lupine.api 1.1.58 → 1.1.59
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 +3 -3
- package/admin/admin-about.tsx +12 -16
- package/admin/admin-config.tsx +47 -44
- package/admin/admin-css.tsx +3 -3
- package/admin/admin-db.tsx +75 -75
- package/admin/admin-frame-helper.tsx +364 -364
- package/admin/admin-frame.tsx +164 -164
- package/admin/admin-index.tsx +65 -65
- package/admin/admin-login.tsx +111 -111
- package/admin/admin-menu-edit.tsx +637 -637
- package/admin/admin-menu-list.tsx +87 -87
- package/admin/admin-page-edit.tsx +564 -564
- package/admin/admin-page-list.tsx +83 -83
- package/admin/admin-performance.tsx +28 -28
- package/admin/admin-release.tsx +427 -426
- package/admin/admin-resources.tsx +382 -382
- package/admin/admin-shell.tsx +89 -89
- package/admin/admin-table-data.tsx +146 -146
- package/admin/admin-table-list.tsx +230 -230
- package/admin/admin-test-animations.tsx +395 -395
- package/admin/admin-test-component.tsx +823 -808
- package/admin/admin-test-edit.tsx +319 -319
- package/admin/admin-test-themes.tsx +56 -56
- package/admin/admin-tokens.tsx +338 -338
- package/admin/design/admin-design.tsx +174 -174
- package/admin/design/block-grid.tsx +36 -36
- package/admin/design/block-grid1.tsx +21 -21
- package/admin/design/block-paragraph.tsx +19 -19
- package/admin/design/block-title.tsx +19 -19
- package/admin/design/design-block-box.tsx +140 -140
- package/admin/design/drag-data.tsx +24 -24
- package/admin/index.ts +9 -9
- package/admin/package.json +15 -15
- package/admin/tsconfig.json +127 -127
- package/dev/copy-folder.js +32 -32
- package/dev/cp-index-html.js +69 -69
- package/dev/file-utils.js +12 -12
- package/dev/index.js +18 -19
- package/dev/package.json +12 -12
- package/dev/plugin-ifelse.js +168 -168
- package/dev/plugin-ifelse.test.js +37 -37
- package/dev/run-cmd.js +14 -14
- package/dev/send-request.js +12 -12
- package/package.json +55 -55
- package/src/admin-api/admin-api-helper.ts +210 -205
- package/src/admin-api/admin-api.ts +65 -65
- package/src/admin-api/admin-auth.ts +152 -146
- package/src/admin-api/admin-config.ts +94 -84
- package/src/admin-api/admin-csv.ts +94 -94
- package/src/admin-api/admin-db.ts +269 -269
- package/src/admin-api/admin-menu.ts +135 -135
- package/src/admin-api/admin-page.ts +135 -135
- package/src/admin-api/admin-performance.ts +128 -128
- package/src/admin-api/admin-release.ts +703 -700
- package/src/admin-api/admin-resources.ts +318 -318
- package/src/admin-api/admin-token-helper.ts +82 -79
- package/src/admin-api/admin-tokens.ts +90 -90
- package/src/admin-api/index.ts +2 -2
- package/src/admin-api/web-config-api.ts +19 -19
- package/src/api/api-cache.ts +103 -103
- package/src/api/api-helper.ts +44 -44
- package/src/api/api-module.ts +67 -60
- package/src/api/api-router.ts +177 -177
- package/src/api/api-shared-storage.ts +64 -64
- package/src/api/async-storage.ts +5 -5
- package/src/api/debug-service.ts +56 -56
- package/src/api/encode-html.ts +27 -27
- package/src/api/handle-status.ts +75 -75
- package/src/api/index.ts +15 -16
- package/src/api/mini-web-socket.ts +270 -270
- package/src/api/server-content-type.ts +82 -82
- package/src/api/server-render.ts +235 -215
- package/src/api/shell-service.ts +74 -74
- package/src/api/simple-storage.ts +80 -80
- package/src/api/static-server.ts +128 -125
- package/src/api/to-client-delivery.ts +26 -26
- package/src/app/app-cache.ts +55 -55
- package/src/app/app-helper.ts +62 -62
- package/src/app/app-message.ts +109 -109
- package/src/app/app-shared-storage.ts +363 -363
- package/src/app/app-start.ts +136 -136
- package/src/app/cleanup-exit.ts +16 -16
- package/src/app/host-to-path.ts +38 -38
- package/src/app/index.ts +11 -11
- package/src/app/process-dev-requests.ts +130 -130
- package/src/app/web-listener.ts +294 -294
- package/src/app/web-processor.ts +47 -42
- package/src/app/web-server.ts +100 -100
- package/src/common-js/web-env.js +104 -104
- package/src/index.ts +7 -7
- package/src/lang/api-lang-en.ts +26 -26
- package/src/lang/api-lang-zh-cn.ts +27 -27
- package/src/lang/index.ts +2 -2
- package/src/lang/lang-helper.ts +76 -76
- package/src/lang/lang-props.ts +6 -6
- package/src/lib/db/db-helper.ts +23 -23
- package/src/lib/db/db-mysql.ts +249 -250
- package/src/lib/db/db-sqlite.ts +101 -101
- package/src/lib/db/db.spec.ts +28 -28
- package/src/lib/db/db.ts +325 -325
- package/src/lib/db/index.ts +5 -5
- package/src/lib/index.ts +3 -3
- package/src/lib/logger.spec.ts +214 -214
- package/src/lib/logger.ts +281 -281
- package/src/lib/runtime-require.ts +37 -37
- package/src/lib/utils/cookie-util.ts +34 -34
- package/src/lib/utils/crypto.ts +58 -58
- package/src/lib/utils/date-utils.ts +317 -317
- package/src/lib/utils/deep-merge.ts +37 -37
- package/src/lib/utils/delay.ts +12 -12
- package/src/lib/utils/file-setting.ts +55 -55
- package/src/lib/utils/format-bytes.ts +11 -11
- package/src/lib/utils/fs-utils.ts +158 -158
- package/src/lib/utils/get-env.ts +27 -27
- package/src/lib/utils/index.ts +12 -12
- package/src/lib/utils/is-type.ts +48 -48
- package/src/lib/utils/load-env.ts +14 -14
- package/src/lib/utils/pad.ts +6 -6
- package/src/models/api-base.ts +5 -5
- package/src/models/api-module-props.ts +10 -11
- package/src/models/api-router-props.ts +26 -26
- package/src/models/app-cache-props.ts +33 -33
- package/src/models/app-data-props.ts +10 -10
- package/src/models/app-helper-props.ts +6 -6
- package/src/models/app-shared-storage-props.ts +38 -38
- package/src/models/app-start-props.ts +18 -18
- package/src/models/async-storage-props.ts +13 -13
- package/src/models/db-config.ts +30 -30
- package/src/models/host-to-path-props.ts +12 -12
- package/src/models/index.ts +16 -16
- package/src/models/json-object.ts +8 -8
- package/src/models/locals-props.ts +36 -36
- package/src/models/logger-props.ts +84 -84
- package/src/models/simple-storage-props.ts +13 -14
- package/src/models/to-client-delivery-props.ts +6 -6
- package/tsconfig.json +115 -115
- package/dev/plugin-gen-versions.js +0 -20
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import { CssProps, isFrontEnd, PageProps } from 'lupine.web';
|
|
2
|
-
import { DesignBlockBox } from './design-block-box';
|
|
3
|
-
import { dragData, findTopBlock } from './drag-data';
|
|
4
|
-
import { BlockGrid } from './block-grid';
|
|
5
|
-
import { BlockTitle } from './block-title';
|
|
6
|
-
import { BlockParagraph } from './block-paragraph';
|
|
7
|
-
|
|
8
|
-
const fetchLogin = async (props: PageProps, username: string, password: string) => {
|
|
9
|
-
const data = await props.renderPageFunctions.fetchData('/api/admin/auth', {
|
|
10
|
-
u: username,
|
|
11
|
-
p: password,
|
|
12
|
-
});
|
|
13
|
-
return data.json;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const AdminDesignPage = async (props: PageProps) => {
|
|
17
|
-
if (!isFrontEnd()) {
|
|
18
|
-
return <div>No SSR.</div>;
|
|
19
|
-
}
|
|
20
|
-
if (window.top === window) {
|
|
21
|
-
return <div>This page should be running in an iframe.</div>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
let dragStarted = false;
|
|
25
|
-
let dragEl: any = null;
|
|
26
|
-
let dragOverEl: any = null;
|
|
27
|
-
// set an object for parent to commutate
|
|
28
|
-
const msgSender = ((window as any)._lj_design = {
|
|
29
|
-
toIframe: (cmd: string, data: any) => {
|
|
30
|
-
console.log('iframe window', cmd, data);
|
|
31
|
-
if (cmd === 'drag-started') {
|
|
32
|
-
dragStarted = true;
|
|
33
|
-
dragEl = data.el;
|
|
34
|
-
}
|
|
35
|
-
if (cmd === 'drag-ended') {
|
|
36
|
-
dragData.resetDragOver();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (cmd === 'add-block') {
|
|
40
|
-
console.log('addBlock', data);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
dragData.resetDragOver = () => {
|
|
46
|
-
if (dragData.overBlock) {
|
|
47
|
-
dragData.overBlock.classList.remove('drag-over');
|
|
48
|
-
dragData.overBlock.classList.remove('drag-over-top');
|
|
49
|
-
dragData.overBlock.classList.remove('drag-over-bottom');
|
|
50
|
-
dragData.overBlock = null;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const css: CssProps = {
|
|
54
|
-
display: 'flex',
|
|
55
|
-
flexDirection: 'column',
|
|
56
|
-
width: '100%',
|
|
57
|
-
height: '100%',
|
|
58
|
-
minHeight: '100%',
|
|
59
|
-
overflowY: 'auto',
|
|
60
|
-
'>.design-container': {
|
|
61
|
-
flexDirection: 'column',
|
|
62
|
-
},
|
|
63
|
-
'.design-container': {
|
|
64
|
-
display: 'flex',
|
|
65
|
-
flex: '1',
|
|
66
|
-
flexWrap: 'wrap',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const drop = (ev: any) => {
|
|
71
|
-
dragStarted = false;
|
|
72
|
-
ev.preventDefault();
|
|
73
|
-
const data = ev.dataTransfer.getData('text/plain');
|
|
74
|
-
console.log('drop', ev, data);
|
|
75
|
-
// ev.target.appendChild(document.getElementById(data));
|
|
76
|
-
if (data === 'block-paragraph') {
|
|
77
|
-
const newBlock = document.createElement('div');
|
|
78
|
-
newBlock.innerHTML = 'new block';
|
|
79
|
-
newBlock.classList.add('design-block-box');
|
|
80
|
-
newBlock.classList.add('dragging');
|
|
81
|
-
newBlock.draggable = true;
|
|
82
|
-
newBlock.addEventListener('dragend', dragData.resetDragOver);
|
|
83
|
-
ev.target.appendChild(newBlock);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (dragOverEl && dragEl) {
|
|
87
|
-
// let dragEl = dragData.dragBlock;
|
|
88
|
-
// if (props.isNewBlock) {
|
|
89
|
-
// dragEl = dragData.dragBlock.clone();
|
|
90
|
-
// }
|
|
91
|
-
|
|
92
|
-
// a design-container without children
|
|
93
|
-
if (dragOverEl.classList.contains('design-container') && dragOverEl.children.length === 1) {
|
|
94
|
-
dragOverEl.appendChild(dragEl);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (dragData.position == 'top') {
|
|
98
|
-
dragOverEl.parentNode.insertBefore(dragEl, dragOverEl);
|
|
99
|
-
} else {
|
|
100
|
-
dragOverEl.parentNode.insertBefore(dragEl, dragOverEl.nextSibling);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const dragOver = (ev: any) => {
|
|
105
|
-
ev.preventDefault();
|
|
106
|
-
console.log('dragData', ev, dragStarted);
|
|
107
|
-
if (!dragStarted) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// whether inside design-container without any children (only style)
|
|
112
|
-
const overContainer = findTopBlock(ev.target, 'design-container');
|
|
113
|
-
console.log('overContainer', overContainer);
|
|
114
|
-
dragOverEl = overContainer;
|
|
115
|
-
if (overContainer && overContainer.children.length === 1) {
|
|
116
|
-
dragData.resetDragOver();
|
|
117
|
-
dragData.overBlock = overContainer;
|
|
118
|
-
overContainer.classList.add('drag-over');
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// over another design-block-box
|
|
123
|
-
const overEl = findTopBlock(ev.target, 'design-block-box');
|
|
124
|
-
if (!overEl || overEl.classList.contains('dragging')) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
dragOverEl = overEl;
|
|
129
|
-
dragData.resetDragOver();
|
|
130
|
-
dragData.overBlock = overEl;
|
|
131
|
-
const rect = overEl.getBoundingClientRect();
|
|
132
|
-
const y = ev.clientY - rect.top;
|
|
133
|
-
if (y < rect.height / 2) {
|
|
134
|
-
dragData.position = 'top';
|
|
135
|
-
overEl.classList.add('drag-over-top');
|
|
136
|
-
}
|
|
137
|
-
if (y > rect.height / 2) {
|
|
138
|
-
dragData.position = 'bottom';
|
|
139
|
-
overEl.classList.add('drag-over-bottom');
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
const dragLeave = (ev: any) => {
|
|
143
|
-
ev.preventDefault();
|
|
144
|
-
dragData.resetDragOver();
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<div css={css} class='design-container-top'>
|
|
149
|
-
<div class='design-container' onDrop={drop} onDragOver={dragOver} onDragLeave={dragLeave}>
|
|
150
|
-
<DesignBlockBox id='1'>
|
|
151
|
-
<BlockTitle>design block one</BlockTitle>
|
|
152
|
-
</DesignBlockBox>
|
|
153
|
-
<DesignBlockBox id='2'>
|
|
154
|
-
<BlockGrid />
|
|
155
|
-
</DesignBlockBox>
|
|
156
|
-
<DesignBlockBox id='3'>
|
|
157
|
-
<BlockTitle>design block three</BlockTitle>
|
|
158
|
-
</DesignBlockBox>
|
|
159
|
-
<DesignBlockBox id='4'>
|
|
160
|
-
<BlockParagraph>design block three</BlockParagraph>
|
|
161
|
-
</DesignBlockBox>
|
|
162
|
-
<DesignBlockBox id='5'>
|
|
163
|
-
<BlockTitle>design block three</BlockTitle>
|
|
164
|
-
</DesignBlockBox>
|
|
165
|
-
<DesignBlockBox id='6'>
|
|
166
|
-
<BlockGrid />
|
|
167
|
-
</DesignBlockBox>
|
|
168
|
-
<DesignBlockBox id='7'>
|
|
169
|
-
<BlockGrid />
|
|
170
|
-
</DesignBlockBox>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
1
|
+
import { CssProps, isFrontEnd, PageProps } from 'lupine.web';
|
|
2
|
+
import { DesignBlockBox } from './design-block-box';
|
|
3
|
+
import { dragData, findTopBlock } from './drag-data';
|
|
4
|
+
import { BlockGrid } from './block-grid';
|
|
5
|
+
import { BlockTitle } from './block-title';
|
|
6
|
+
import { BlockParagraph } from './block-paragraph';
|
|
7
|
+
|
|
8
|
+
const fetchLogin = async (props: PageProps, username: string, password: string) => {
|
|
9
|
+
const data = await props.renderPageFunctions.fetchData('/api/admin/auth', {
|
|
10
|
+
u: username,
|
|
11
|
+
p: password,
|
|
12
|
+
});
|
|
13
|
+
return data.json;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const AdminDesignPage = async (props: PageProps) => {
|
|
17
|
+
if (!isFrontEnd()) {
|
|
18
|
+
return <div>No SSR.</div>;
|
|
19
|
+
}
|
|
20
|
+
if (window.top === window) {
|
|
21
|
+
return <div>This page should be running in an iframe.</div>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let dragStarted = false;
|
|
25
|
+
let dragEl: any = null;
|
|
26
|
+
let dragOverEl: any = null;
|
|
27
|
+
// set an object for parent to commutate
|
|
28
|
+
const msgSender = ((window as any)._lj_design = {
|
|
29
|
+
toIframe: (cmd: string, data: any) => {
|
|
30
|
+
console.log('iframe window', cmd, data);
|
|
31
|
+
if (cmd === 'drag-started') {
|
|
32
|
+
dragStarted = true;
|
|
33
|
+
dragEl = data.el;
|
|
34
|
+
}
|
|
35
|
+
if (cmd === 'drag-ended') {
|
|
36
|
+
dragData.resetDragOver();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (cmd === 'add-block') {
|
|
40
|
+
console.log('addBlock', data);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
dragData.resetDragOver = () => {
|
|
46
|
+
if (dragData.overBlock) {
|
|
47
|
+
dragData.overBlock.classList.remove('drag-over');
|
|
48
|
+
dragData.overBlock.classList.remove('drag-over-top');
|
|
49
|
+
dragData.overBlock.classList.remove('drag-over-bottom');
|
|
50
|
+
dragData.overBlock = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const css: CssProps = {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
width: '100%',
|
|
57
|
+
height: '100%',
|
|
58
|
+
minHeight: '100%',
|
|
59
|
+
overflowY: 'auto',
|
|
60
|
+
'>.design-container': {
|
|
61
|
+
flexDirection: 'column',
|
|
62
|
+
},
|
|
63
|
+
'.design-container': {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flex: '1',
|
|
66
|
+
flexWrap: 'wrap',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const drop = (ev: any) => {
|
|
71
|
+
dragStarted = false;
|
|
72
|
+
ev.preventDefault();
|
|
73
|
+
const data = ev.dataTransfer.getData('text/plain');
|
|
74
|
+
console.log('drop', ev, data);
|
|
75
|
+
// ev.target.appendChild(document.getElementById(data));
|
|
76
|
+
if (data === 'block-paragraph') {
|
|
77
|
+
const newBlock = document.createElement('div');
|
|
78
|
+
newBlock.innerHTML = 'new block';
|
|
79
|
+
newBlock.classList.add('design-block-box');
|
|
80
|
+
newBlock.classList.add('dragging');
|
|
81
|
+
newBlock.draggable = true;
|
|
82
|
+
newBlock.addEventListener('dragend', dragData.resetDragOver);
|
|
83
|
+
ev.target.appendChild(newBlock);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (dragOverEl && dragEl) {
|
|
87
|
+
// let dragEl = dragData.dragBlock;
|
|
88
|
+
// if (props.isNewBlock) {
|
|
89
|
+
// dragEl = dragData.dragBlock.clone();
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
// a design-container without children
|
|
93
|
+
if (dragOverEl.classList.contains('design-container') && dragOverEl.children.length === 1) {
|
|
94
|
+
dragOverEl.appendChild(dragEl);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (dragData.position == 'top') {
|
|
98
|
+
dragOverEl.parentNode.insertBefore(dragEl, dragOverEl);
|
|
99
|
+
} else {
|
|
100
|
+
dragOverEl.parentNode.insertBefore(dragEl, dragOverEl.nextSibling);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const dragOver = (ev: any) => {
|
|
105
|
+
ev.preventDefault();
|
|
106
|
+
console.log('dragData', ev, dragStarted);
|
|
107
|
+
if (!dragStarted) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// whether inside design-container without any children (only style)
|
|
112
|
+
const overContainer = findTopBlock(ev.target, 'design-container');
|
|
113
|
+
console.log('overContainer', overContainer);
|
|
114
|
+
dragOverEl = overContainer;
|
|
115
|
+
if (overContainer && overContainer.children.length === 1) {
|
|
116
|
+
dragData.resetDragOver();
|
|
117
|
+
dragData.overBlock = overContainer;
|
|
118
|
+
overContainer.classList.add('drag-over');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// over another design-block-box
|
|
123
|
+
const overEl = findTopBlock(ev.target, 'design-block-box');
|
|
124
|
+
if (!overEl || overEl.classList.contains('dragging')) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
dragOverEl = overEl;
|
|
129
|
+
dragData.resetDragOver();
|
|
130
|
+
dragData.overBlock = overEl;
|
|
131
|
+
const rect = overEl.getBoundingClientRect();
|
|
132
|
+
const y = ev.clientY - rect.top;
|
|
133
|
+
if (y < rect.height / 2) {
|
|
134
|
+
dragData.position = 'top';
|
|
135
|
+
overEl.classList.add('drag-over-top');
|
|
136
|
+
}
|
|
137
|
+
if (y > rect.height / 2) {
|
|
138
|
+
dragData.position = 'bottom';
|
|
139
|
+
overEl.classList.add('drag-over-bottom');
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const dragLeave = (ev: any) => {
|
|
143
|
+
ev.preventDefault();
|
|
144
|
+
dragData.resetDragOver();
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<div css={css} class='design-container-top'>
|
|
149
|
+
<div class='design-container' onDrop={drop} onDragOver={dragOver} onDragLeave={dragLeave}>
|
|
150
|
+
<DesignBlockBox id='1'>
|
|
151
|
+
<BlockTitle>design block one</BlockTitle>
|
|
152
|
+
</DesignBlockBox>
|
|
153
|
+
<DesignBlockBox id='2'>
|
|
154
|
+
<BlockGrid />
|
|
155
|
+
</DesignBlockBox>
|
|
156
|
+
<DesignBlockBox id='3'>
|
|
157
|
+
<BlockTitle>design block three</BlockTitle>
|
|
158
|
+
</DesignBlockBox>
|
|
159
|
+
<DesignBlockBox id='4'>
|
|
160
|
+
<BlockParagraph>design block three</BlockParagraph>
|
|
161
|
+
</DesignBlockBox>
|
|
162
|
+
<DesignBlockBox id='5'>
|
|
163
|
+
<BlockTitle>design block three</BlockTitle>
|
|
164
|
+
</DesignBlockBox>
|
|
165
|
+
<DesignBlockBox id='6'>
|
|
166
|
+
<BlockGrid />
|
|
167
|
+
</DesignBlockBox>
|
|
168
|
+
<DesignBlockBox id='7'>
|
|
169
|
+
<BlockGrid />
|
|
170
|
+
</DesignBlockBox>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { CssProps } from 'lupine.web';
|
|
2
|
-
import { DesignBlockBox } from './design-block-box';
|
|
3
|
-
import { BlockTitle } from './block-title';
|
|
4
|
-
|
|
5
|
-
export type BlockGridProps = {};
|
|
6
|
-
export const BlockGrid = (props: BlockGridProps) => {
|
|
7
|
-
const css: CssProps = {
|
|
8
|
-
display: 'flex',
|
|
9
|
-
flexDirection: 'row',
|
|
10
|
-
width: '100%',
|
|
11
|
-
margin: '10px 0 0 0',
|
|
12
|
-
'>div': {
|
|
13
|
-
width: '-webkit-fill-available',
|
|
14
|
-
},
|
|
15
|
-
'&.drag-over': {
|
|
16
|
-
backgroundColor: 'red',
|
|
17
|
-
},
|
|
18
|
-
'&:not(:has(div))': {
|
|
19
|
-
padding: '10px',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div css={css} class='design-container grid'>
|
|
25
|
-
<DesignBlockBox id='1'>
|
|
26
|
-
<BlockTitle>design block 1</BlockTitle>
|
|
27
|
-
</DesignBlockBox>
|
|
28
|
-
<DesignBlockBox id='2'>
|
|
29
|
-
<BlockTitle>design block 2</BlockTitle>
|
|
30
|
-
</DesignBlockBox>
|
|
31
|
-
<DesignBlockBox id='3'>
|
|
32
|
-
<BlockTitle>design block 3</BlockTitle>
|
|
33
|
-
</DesignBlockBox>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
1
|
+
import { CssProps } from 'lupine.web';
|
|
2
|
+
import { DesignBlockBox } from './design-block-box';
|
|
3
|
+
import { BlockTitle } from './block-title';
|
|
4
|
+
|
|
5
|
+
export type BlockGridProps = {};
|
|
6
|
+
export const BlockGrid = (props: BlockGridProps) => {
|
|
7
|
+
const css: CssProps = {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'row',
|
|
10
|
+
width: '100%',
|
|
11
|
+
margin: '10px 0 0 0',
|
|
12
|
+
'>div': {
|
|
13
|
+
width: '-webkit-fill-available',
|
|
14
|
+
},
|
|
15
|
+
'&.drag-over': {
|
|
16
|
+
backgroundColor: 'red',
|
|
17
|
+
},
|
|
18
|
+
'&:not(:has(div))': {
|
|
19
|
+
padding: '10px',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div css={css} class='design-container grid'>
|
|
25
|
+
<DesignBlockBox id='1'>
|
|
26
|
+
<BlockTitle>design block 1</BlockTitle>
|
|
27
|
+
</DesignBlockBox>
|
|
28
|
+
<DesignBlockBox id='2'>
|
|
29
|
+
<BlockTitle>design block 2</BlockTitle>
|
|
30
|
+
</DesignBlockBox>
|
|
31
|
+
<DesignBlockBox id='3'>
|
|
32
|
+
<BlockTitle>design block 3</BlockTitle>
|
|
33
|
+
</DesignBlockBox>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { CssProps } from 'lupine.web';
|
|
2
|
-
|
|
3
|
-
export type BlockGridProps = {};
|
|
4
|
-
export const BlockGrid = (props: BlockGridProps) => {
|
|
5
|
-
const css: CssProps = {
|
|
6
|
-
display: 'flex',
|
|
7
|
-
flexDirection: 'row',
|
|
8
|
-
width: '100%',
|
|
9
|
-
'>div': {
|
|
10
|
-
width: '33.33%',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div css={css} class='block-item grid'>
|
|
16
|
-
<div contentEditable={true}>design block one</div>
|
|
17
|
-
<div contentEditable={true}>design block two</div>
|
|
18
|
-
<div contentEditable={true}>design block three</div>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import { CssProps } from 'lupine.web';
|
|
2
|
+
|
|
3
|
+
export type BlockGridProps = {};
|
|
4
|
+
export const BlockGrid = (props: BlockGridProps) => {
|
|
5
|
+
const css: CssProps = {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
width: '100%',
|
|
9
|
+
'>div': {
|
|
10
|
+
width: '33.33%',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div css={css} class='block-item grid'>
|
|
16
|
+
<div contentEditable={true}>design block one</div>
|
|
17
|
+
<div contentEditable={true}>design block two</div>
|
|
18
|
+
<div contentEditable={true}>design block three</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentChildren, CssProps } from 'lupine.web';
|
|
2
|
-
import { DesignBlockBox } from './design-block-box';
|
|
3
|
-
|
|
4
|
-
export type BlockGridProps = {
|
|
5
|
-
children: ComponentChildren;
|
|
6
|
-
};
|
|
7
|
-
export const BlockParagraph = (props: BlockGridProps) => {
|
|
8
|
-
const css: CssProps = {
|
|
9
|
-
// width: '100%',
|
|
10
|
-
fontSize: 'var(--font-size-paragraph)',
|
|
11
|
-
margin: '8px 16px',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div css={css} class='block-paragraph'>
|
|
16
|
-
{props.children}
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
1
|
+
import { ComponentChildren, CssProps } from 'lupine.web';
|
|
2
|
+
import { DesignBlockBox } from './design-block-box';
|
|
3
|
+
|
|
4
|
+
export type BlockGridProps = {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
};
|
|
7
|
+
export const BlockParagraph = (props: BlockGridProps) => {
|
|
8
|
+
const css: CssProps = {
|
|
9
|
+
// width: '100%',
|
|
10
|
+
fontSize: 'var(--font-size-paragraph)',
|
|
11
|
+
margin: '8px 16px',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div css={css} class='block-paragraph'>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ComponentChildren, CssProps } from 'lupine.web';
|
|
2
|
-
import { DesignBlockBox } from './design-block-box';
|
|
3
|
-
|
|
4
|
-
export type BlockGridProps = {
|
|
5
|
-
children: ComponentChildren;
|
|
6
|
-
};
|
|
7
|
-
export const BlockTitle = (props: BlockGridProps) => {
|
|
8
|
-
const css: CssProps = {
|
|
9
|
-
// width: '100%',
|
|
10
|
-
fontSize: 'var(--font-size-title)',
|
|
11
|
-
margin: '8px 16px',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div css={css} class='block-title'>
|
|
16
|
-
{props.children}
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
1
|
+
import { ComponentChildren, CssProps } from 'lupine.web';
|
|
2
|
+
import { DesignBlockBox } from './design-block-box';
|
|
3
|
+
|
|
4
|
+
export type BlockGridProps = {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
};
|
|
7
|
+
export const BlockTitle = (props: BlockGridProps) => {
|
|
8
|
+
const css: CssProps = {
|
|
9
|
+
// width: '100%',
|
|
10
|
+
fontSize: 'var(--font-size-title)',
|
|
11
|
+
margin: '8px 16px',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div css={css} class='block-title'>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|