goblin-magic 1.0.3

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.
Files changed (88) hide show
  1. package/.editorconfig +9 -0
  2. package/.zou-flow +2 -0
  3. package/eslint.config.js +65 -0
  4. package/magicNavigation.js +7 -0
  5. package/package.json +45 -0
  6. package/widgets/dialog/widget.js +78 -0
  7. package/widgets/element-helpers/element-has-direct-text.js +9 -0
  8. package/widgets/element-helpers/is-empty-area-element.js +17 -0
  9. package/widgets/element-helpers/is-flat-element.js +52 -0
  10. package/widgets/get-modifiers/get-modifiers.js +34 -0
  11. package/widgets/input-group/styles.js +74 -0
  12. package/widgets/input-group/widget.js +24 -0
  13. package/widgets/magic-action/styles.js +45 -0
  14. package/widgets/magic-action/widget.js +44 -0
  15. package/widgets/magic-background/bg-alps.jpg +0 -0
  16. package/widgets/magic-background/bg-fur.png +0 -0
  17. package/widgets/magic-background/bg-milkyway.png +0 -0
  18. package/widgets/magic-background/bg-space.jpg +0 -0
  19. package/widgets/magic-background/bg-synth.jpg +0 -0
  20. package/widgets/magic-background/bg-white.png +0 -0
  21. package/widgets/magic-background/styles.js +81 -0
  22. package/widgets/magic-background/widget.js +20 -0
  23. package/widgets/magic-box/styles.js +10 -0
  24. package/widgets/magic-box/widget.js +28 -0
  25. package/widgets/magic-box-old/styles.js +111 -0
  26. package/widgets/magic-box-old/widget.js +30 -0
  27. package/widgets/magic-button/styles.js +156 -0
  28. package/widgets/magic-button/widget.js +89 -0
  29. package/widgets/magic-checkbox/styles.js +116 -0
  30. package/widgets/magic-checkbox/widget.js +68 -0
  31. package/widgets/magic-color-field/styles.js +22 -0
  32. package/widgets/magic-color-field/widget.js +68 -0
  33. package/widgets/magic-date-field/styles.js +9 -0
  34. package/widgets/magic-date-field/widget.js +145 -0
  35. package/widgets/magic-datetime-field/styles.js +11 -0
  36. package/widgets/magic-datetime-field/widget.js +95 -0
  37. package/widgets/magic-dialog/styles.js +39 -0
  38. package/widgets/magic-dialog/widget.js +116 -0
  39. package/widgets/magic-div/styles.js +22 -0
  40. package/widgets/magic-div/widget.js +20 -0
  41. package/widgets/magic-emoji/styles.js +14 -0
  42. package/widgets/magic-emoji/widget.js +33 -0
  43. package/widgets/magic-emoji-picker/styles.js +21 -0
  44. package/widgets/magic-emoji-picker/widget.js +44 -0
  45. package/widgets/magic-inplace-input/styles.js +55 -0
  46. package/widgets/magic-inplace-input/widget.js +26 -0
  47. package/widgets/magic-input/styles.js +50 -0
  48. package/widgets/magic-input/widget.js +397 -0
  49. package/widgets/magic-label/styles.js +20 -0
  50. package/widgets/magic-label/widget.js +24 -0
  51. package/widgets/magic-navigation/service.js +1306 -0
  52. package/widgets/magic-navigation/styles.js +103 -0
  53. package/widgets/magic-navigation/view-context.js +15 -0
  54. package/widgets/magic-navigation/widget.js +540 -0
  55. package/widgets/magic-number-field/styles.js +10 -0
  56. package/widgets/magic-number-field/widget.js +103 -0
  57. package/widgets/magic-panel/styles.js +61 -0
  58. package/widgets/magic-panel/widget.js +63 -0
  59. package/widgets/magic-radio/styles.js +93 -0
  60. package/widgets/magic-radio/widget.js +74 -0
  61. package/widgets/magic-scroll/styles.js +22 -0
  62. package/widgets/magic-scroll/widget.js +20 -0
  63. package/widgets/magic-select/styles.js +16 -0
  64. package/widgets/magic-select/widget.js +134 -0
  65. package/widgets/magic-table/reducer.js +63 -0
  66. package/widgets/magic-table/styles.js +170 -0
  67. package/widgets/magic-table/widget.js +627 -0
  68. package/widgets/magic-tag/styles.js +32 -0
  69. package/widgets/magic-tag/widget.js +32 -0
  70. package/widgets/magic-text-field/styles.js +58 -0
  71. package/widgets/magic-text-field/widget.js +66 -0
  72. package/widgets/magic-time-field/styles.js +8 -0
  73. package/widgets/magic-time-field/widget.js +142 -0
  74. package/widgets/magic-timer/styles.js +30 -0
  75. package/widgets/magic-timer/widget.js +162 -0
  76. package/widgets/magic-zen/styles.js +61 -0
  77. package/widgets/magic-zen/widget.js +42 -0
  78. package/widgets/main-tabs/styles.js +106 -0
  79. package/widgets/main-tabs/widget.js +23 -0
  80. package/widgets/menu/styles.js +156 -0
  81. package/widgets/menu/test-menu.html +154 -0
  82. package/widgets/menu/widget.js +575 -0
  83. package/widgets/movable/widget.js +80 -0
  84. package/widgets/splitter/styles.js +57 -0
  85. package/widgets/splitter/widget.js +40 -0
  86. package/widgets/tab-layout/styles.js +31 -0
  87. package/widgets/tab-layout/widget.js +59 -0
  88. package/widgets/with-computed-size/widget.js +52 -0
@@ -0,0 +1,170 @@
1
+ /******************************************************************************/
2
+
3
+ export default function styles() {
4
+ const magicTable = {
5
+ display: 'grid',
6
+ overflow: 'auto',
7
+ // 'grid-template-columns': '', // Defined in the widget
8
+ zIndex: 0, // Ensure that 'z-index -1' in the content is not below the table
9
+ position: 'relative', // To make z-index work
10
+ paddingBottom: '1px', // Fix scrollbar visible even when there is enough space
11
+ marginBottom: '-1px', // To compensate for the above padding
12
+ };
13
+
14
+ const row = {
15
+ 'display': 'grid',
16
+ 'grid-template-columns': 'subgrid',
17
+ 'grid-column': '1 / -1',
18
+ };
19
+
20
+ const tableHeader = {
21
+ ...row,
22
+
23
+ 'position': 'sticky',
24
+ 'top': 0,
25
+
26
+ 'fontWeight': 'bold',
27
+
28
+ '& > *': {
29
+ 'display': 'flex',
30
+ 'alignItems': 'flex-end',
31
+ 'justifyContent': 'space-between',
32
+ 'padding': '7px 5px 7px 10px',
33
+ 'backgroundColor': 'rgb(30,40,62)',
34
+ '@media (prefers-color-scheme: light)': {
35
+ backgroundColor: 'rgb(194,222,235)',
36
+ },
37
+ // background: 'linear-gradient(to right, rgb(36,49,77), rgb(31,39,57))',
38
+ // backgroundColor: 'rgba(0, 0, 0, 0.15)',
39
+ },
40
+
41
+ '& > .sortable': {
42
+ 'display': 'flex',
43
+ 'justifyContent': 'space-around',
44
+ 'cursor': 'pointer',
45
+ 'position': 'relative',
46
+ ':hover': {
47
+ 'backgroundColor':
48
+ 'color-mix(in srgb, var(--accent-color) 20%, rgb(30,40,62))',
49
+ '@media (prefers-color-scheme: light)': {
50
+ backgroundColor:
51
+ 'color-mix(in srgb, var(--accent-color) 20%, rgb(194,222,235))',
52
+ },
53
+ },
54
+ '& > .icon': {
55
+ position: 'absolute',
56
+ top: '-5px',
57
+ },
58
+ '& > .text': {
59
+ width: '100%',
60
+ },
61
+ },
62
+
63
+ '& > :first-child': {
64
+ borderTopLeftRadius: '6px',
65
+ },
66
+
67
+ '& > :last-child': {
68
+ borderTopRightRadius: '6px',
69
+ },
70
+ };
71
+
72
+ const magicTableRow = {
73
+ ...row,
74
+ 'zIndex': -1, // Because some elements (like svg, buttons and img) goes above sticky...
75
+
76
+ '& > *': {
77
+ padding: '7px 10px',
78
+ borderTop:
79
+ '1px solid color-mix(in srgb, var(--text-color), transparent 85%)',
80
+ backgroundColor: 'rgba(255,255,255, 0.025)',
81
+ },
82
+ '&:last-child > *': {
83
+ borderBottom:
84
+ '1px solid color-mix(in srgb, var(--text-color), transparent 85%)',
85
+ },
86
+
87
+ '&:nth-child(2n+1) > *:not(dialog)': {
88
+ backgroundColor: 'rgba(0, 0, 0, 0.025)',
89
+ },
90
+
91
+ '&[data-clickable=true]': {
92
+ '& > *': {
93
+ cursor: 'pointer',
94
+ },
95
+ ':hover > *:not(dialog)': {
96
+ backgroundColor:
97
+ 'color-mix(in srgb, var(--accent-color), transparent 90%)',
98
+ },
99
+ },
100
+
101
+ '& > :first-child:last-child': {
102
+ // Only one element in the row
103
+ gridColumn: '1 / -1', // Span the whole line
104
+ },
105
+ };
106
+
107
+ const emptyRow = {
108
+ gridColumn: '1 / -1',
109
+ };
110
+
111
+ const rowSeparator = {
112
+ 'gridColumn': '1 / -1',
113
+ '&:not(:last-child)': {
114
+ marginBottom: '-1px',
115
+ borderBottom: '2px dashed rgba(177,123,41,0.9)',
116
+ },
117
+ };
118
+
119
+ const selectionTitle = {
120
+ 'cursor': 'pointer',
121
+ '& > *': {
122
+ opacity: 0.2,
123
+ },
124
+ ':hover > *': {
125
+ opacity: 0.6,
126
+ },
127
+ };
128
+
129
+ const tableCheck = {
130
+ '& > *': {
131
+ opacity: 0.2,
132
+ },
133
+ ':hover > *': {
134
+ opacity: 0.6,
135
+ },
136
+ '&[data-checked=true] > *': {
137
+ opacity: 0.7,
138
+ color: 'rgb(255,177,60)',
139
+ boxShadow: '0px 0px 3px rgb(255,153,0)',
140
+ },
141
+ '& + :nth-child(2):last-child': {
142
+ // Only one element in the row after the checkbox
143
+ gridColumn: '2 / -1', // Span the whole line
144
+ },
145
+ };
146
+
147
+ const tableOptions = {
148
+ ...row,
149
+
150
+ '& > .menu': {
151
+ display: 'flex',
152
+ alignItems: 'flex-end',
153
+ justifyContent: 'space-between',
154
+ backgroundColor: 'rgb(30,40,62)',
155
+ },
156
+ };
157
+
158
+ return {
159
+ magicTable,
160
+ tableHeader,
161
+ magicTableRow,
162
+ emptyRow,
163
+ rowSeparator,
164
+ selectionTitle,
165
+ tableCheck,
166
+ tableOptions,
167
+ };
168
+ }
169
+
170
+ /******************************************************************************/