fomantic-ui 2.10.0-beta.0 → 2.10.0-beta.10
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/.all-contributorsrc +9 -0
- package/.eslintrc.js +0 -10
- package/.github/workflows/ci.yml +3 -3
- package/CONTRIBUTING.md +4 -1
- package/CONTRIBUTORS.md +1 -0
- package/FAQ.md +7 -2
- package/README.md +5 -9
- package/ROADMAP.md +4 -4
- package/SECURITY.md +8 -7
- package/changelog-setup.js +64 -70
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +103 -142
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +157 -210
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -2
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -2
- package/dist/components/calendar.js +314 -352
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -2
- package/dist/components/checkbox.js +85 -135
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +2 -4
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +1 -11
- package/dist/components/dimmer.js +61 -94
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -2
- package/dist/components/divider.min.css +2 -2
- package/dist/components/dropdown.css +30 -51
- package/dist/components/dropdown.js +736 -1055
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +85 -114
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +3809 -7617
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +2 -3
- package/dist/components/flyout.js +226 -355
- package/dist/components/flyout.min.css +2 -2
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +5 -95
- package/dist/components/form.js +335 -444
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +2 -58
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +4 -4
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -536
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -3
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -9
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +5 -9
- package/dist/components/modal.js +261 -384
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +68 -98
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -2
- package/dist/components/popup.js +198 -271
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +109 -144
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +91 -123
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +2 -9
- package/dist/components/search.js +277 -379
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +2 -7
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -2
- package/dist/components/shape.js +158 -224
- package/dist/components/shape.min.css +2 -2
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +2 -3
- package/dist/components/sidebar.js +124 -206
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +9 -25
- package/dist/components/site.js +38 -57
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +246 -329
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +70 -100
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +135 -180
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +176 -244
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +3 -37
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -3
- package/dist/components/toast.js +109 -147
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +91 -146
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +146 -224
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +3906 -8720
- package/dist/semantic.js +4397 -6155
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/assets/show-examples.js +2 -4
- package/gulpfile.js +5 -7
- package/package.json +20 -16
- package/scripts/nightly-version.js +7 -10
- package/src/README.md +3 -3
- package/src/definitions/behaviors/api.js +156 -209
- package/src/definitions/behaviors/form.js +334 -443
- package/src/definitions/behaviors/state.js +69 -99
- package/src/definitions/behaviors/visibility.js +145 -223
- package/src/definitions/collections/form.less +1 -13
- package/src/definitions/collections/grid.less +1 -61
- package/src/definitions/collections/menu.less +0 -11
- package/src/definitions/collections/table.less +1 -35
- package/src/definitions/elements/input.less +1 -61
- package/src/definitions/elements/segment.less +0 -6
- package/src/definitions/globals/site.js +37 -56
- package/src/definitions/globals/site.less +2 -18
- package/src/definitions/modules/accordion.js +102 -141
- package/src/definitions/modules/calendar.js +313 -351
- package/src/definitions/modules/checkbox.js +84 -134
- package/src/definitions/modules/dimmer.js +60 -93
- package/src/definitions/modules/dimmer.less +0 -9
- package/src/definitions/modules/dropdown.js +735 -1054
- package/src/definitions/modules/dropdown.less +31 -47
- package/src/definitions/modules/embed.js +84 -113
- package/src/definitions/modules/flyout.js +225 -354
- package/src/definitions/modules/modal.js +260 -383
- package/src/definitions/modules/modal.less +1 -1
- package/src/definitions/modules/nag.js +67 -97
- package/src/definitions/modules/popup.js +197 -270
- package/src/definitions/modules/progress.js +108 -143
- package/src/definitions/modules/rating.js +90 -122
- package/src/definitions/modules/search.js +276 -378
- package/src/definitions/modules/search.less +0 -3
- package/src/definitions/modules/shape.js +157 -223
- package/src/definitions/modules/sidebar.js +123 -205
- package/src/definitions/modules/slider.js +245 -328
- package/src/definitions/modules/slider.less +1 -1
- package/src/definitions/modules/sticky.js +134 -179
- package/src/definitions/modules/tab.js +175 -243
- package/src/definitions/modules/toast.js +108 -146
- package/src/definitions/modules/toast.less +1 -1
- package/src/definitions/modules/transition.js +90 -145
- package/src/theme.less +0 -13
- package/src/themes/basic/elements/icon.variables +1 -1
- package/src/themes/default/collections/grid.variables +0 -30
- package/src/themes/default/collections/table.variables +1 -5
- package/src/themes/default/elements/icon.variables +3 -3
- package/src/themes/default/globals/site.variables +8 -15
- package/src/themes/default/globals/variation.variables +1 -2
- package/src/themes/default/modules/dropdown.variables +1 -0
- package/src/themes/default/modules/slider.variables +1 -1
- package/src/themes/github/elements/icon.variables +1 -1
- package/src/themes/material/elements/icon.variables +1 -1
- package/tasks/README.md +1 -1
- package/tasks/admin/components/create.js +89 -122
- package/tasks/admin/components/init.js +34 -65
- package/tasks/admin/components/update.js +50 -61
- package/tasks/admin/distributions/create.js +71 -111
- package/tasks/admin/distributions/init.js +32 -63
- package/tasks/admin/distributions/update.js +49 -57
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/register.js +14 -19
- package/tasks/admin/release.js +2 -2
- package/tasks/build/assets.js +14 -18
- package/tasks/build/css.js +59 -68
- package/tasks/build/javascript.js +48 -56
- package/tasks/build.js +4 -6
- package/tasks/check-install.js +5 -8
- package/tasks/clean.js +5 -7
- package/tasks/collections/admin.js +14 -16
- package/tasks/collections/build.js +6 -8
- package/tasks/collections/docs.js +4 -6
- package/tasks/collections/install.js +2 -4
- package/tasks/collections/rtl.js +2 -4
- package/tasks/collections/various.js +2 -4
- package/tasks/config/admin/github.js +9 -19
- package/tasks/config/admin/templates/README.md +2 -2
- package/tasks/config/admin/templates/bower.json +2 -4
- package/tasks/config/admin/templates/composer.json +1 -1
- package/tasks/config/admin/templates/css-package.js +1 -4
- package/tasks/config/admin/templates/less-package.js +1 -3
- package/tasks/config/defaults.js +0 -1
- package/tasks/config/npm/gulpfile.js +4 -6
- package/tasks/config/project/config.js +27 -35
- package/tasks/config/project/install.js +64 -82
- package/tasks/config/project/release.js +7 -9
- package/tasks/config/tasks.js +16 -30
- package/tasks/config/user.js +14 -20
- package/tasks/docs/build.js +26 -31
- package/tasks/docs/metadata.js +30 -39
- package/tasks/docs/serve.js +23 -27
- package/tasks/install.js +94 -128
- package/tasks/rtl/build.js +2 -4
- package/tasks/rtl/watch.js +3 -5
- package/tasks/watch.js +13 -13
- package/test/meteor/fonts.js +1 -2
- package/test/modules/module.spec.js +16 -18
- package/types/fomantic-ui-calendar.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +45 -1
- package/types/fomantic-ui-embed.d.ts +1 -1
- package/types/fomantic-ui-flyout.d.ts +1 -1
- package/types/fomantic-ui-form.d.ts +0 -7
- package/types/fomantic-ui-modal.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +12 -6
- package/types/fomantic-ui-toast.d.ts +1 -1
- package/src/themes/basic/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/src/themes/default/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/src/themes/github/assets/fonts/octicons.woff +0 -0
- package/src/themes/material/assets/fonts/icons.woff +0 -0
@@ -2,13 +2,10 @@
|
|
2
2
|
Set-up
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
defaults = require('../defaults'),
|
10
|
-
release = require('./release')
|
11
|
-
;
|
5
|
+
const path = require('node:path');
|
6
|
+
const requireDotFile = require('require-dot-file');
|
7
|
+
const defaults = require('../defaults');
|
8
|
+
const release = require('./release');
|
12
9
|
|
13
10
|
/*******************************
|
14
11
|
When to Ask
|
@@ -83,50 +80,44 @@ module.exports = {
|
|
83
80
|
|
84
81
|
// detect whether there is a semantic.json configuration and that the auto-install option is set to true
|
85
82
|
shouldAutoInstall: function () {
|
86
|
-
let
|
87
|
-
config = when.hasConfig()
|
88
|
-
;
|
83
|
+
let config = when.hasConfig();
|
89
84
|
|
90
85
|
return config.autoInstall;
|
91
86
|
},
|
92
87
|
|
93
88
|
// checks if files are in a PM directory
|
94
89
|
getPackageManager: function (directory) {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
name: 'Bower',
|
106
|
-
root: nextDirectory,
|
107
|
-
};
|
108
|
-
}
|
109
|
-
if (folder === 'node_modules') {
|
110
|
-
return {
|
111
|
-
name: 'NPM',
|
112
|
-
root: nextDirectory,
|
113
|
-
};
|
114
|
-
}
|
115
|
-
if (folder === 'composer') {
|
116
|
-
return {
|
117
|
-
name: 'Composer',
|
118
|
-
root: nextDirectory,
|
119
|
-
};
|
120
|
-
}
|
121
|
-
if (path.resolve(directory) === path.resolve(nextDirectory)) {
|
122
|
-
return false;
|
123
|
-
}
|
124
|
-
|
125
|
-
// recurse downward
|
126
|
-
return walk(nextDirectory);
|
90
|
+
// returns last matching result (avoid sub-module detection)
|
91
|
+
let walk = function (directory) {
|
92
|
+
let pathArray = directory.split(path.sep);
|
93
|
+
let folder = pathArray[pathArray.length - 1];
|
94
|
+
let nextDirectory = path.join(directory, path.sep, '..');
|
95
|
+
if (folder === 'bower_components') {
|
96
|
+
return {
|
97
|
+
name: 'Bower',
|
98
|
+
root: nextDirectory,
|
99
|
+
};
|
127
100
|
}
|
128
|
-
|
129
|
-
|
101
|
+
if (folder === 'node_modules') {
|
102
|
+
return {
|
103
|
+
name: 'NPM',
|
104
|
+
root: nextDirectory,
|
105
|
+
};
|
106
|
+
}
|
107
|
+
if (folder === 'composer') {
|
108
|
+
return {
|
109
|
+
name: 'Composer',
|
110
|
+
root: nextDirectory,
|
111
|
+
};
|
112
|
+
}
|
113
|
+
if (path.resolve(directory) === path.resolve(nextDirectory)) {
|
114
|
+
return false;
|
115
|
+
}
|
116
|
+
|
117
|
+
// recurse downward
|
118
|
+
return walk(nextDirectory);
|
119
|
+
};
|
120
|
+
// start walk from the current directory if none specified
|
130
121
|
directory = directory || path.join(__dirname, path.sep);
|
131
122
|
|
132
123
|
return walk(directory);
|
@@ -134,27 +125,23 @@ module.exports = {
|
|
134
125
|
|
135
126
|
// checks if files is PMed submodule
|
136
127
|
isSubModule: function (directory) {
|
137
|
-
let
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
moduleFolders++;
|
147
|
-
} else if (folder === '.pnpm') {
|
148
|
-
moduleFolders--;
|
149
|
-
}
|
150
|
-
if (path.resolve(directory) === path.resolve(nextDirectory)) {
|
151
|
-
return moduleFolders > 1;
|
152
|
-
}
|
153
|
-
|
154
|
-
// recurse downward
|
155
|
-
return walk(nextDirectory);
|
128
|
+
let moduleFolders = 0;
|
129
|
+
let walk = function (directory) {
|
130
|
+
let pathArray = directory.split(path.sep);
|
131
|
+
let folder = pathArray[pathArray.length - 2];
|
132
|
+
let nextDirectory = path.join(directory, path.sep, '..');
|
133
|
+
if (['bower_components', 'node_modules', 'composer'].includes(folder)) {
|
134
|
+
moduleFolders++;
|
135
|
+
} else if (folder === '.pnpm') {
|
136
|
+
moduleFolders--;
|
156
137
|
}
|
157
|
-
|
138
|
+
if (path.resolve(directory) === path.resolve(nextDirectory)) {
|
139
|
+
return moduleFolders > 1;
|
140
|
+
}
|
141
|
+
|
142
|
+
// recurse downward
|
143
|
+
return walk(nextDirectory);
|
144
|
+
};
|
158
145
|
// start walk from current directory if none specified
|
159
146
|
directory = directory || path.join(__dirname, path.sep);
|
160
147
|
|
@@ -162,14 +149,12 @@ module.exports = {
|
|
162
149
|
},
|
163
150
|
|
164
151
|
createJSON: function (answers) {
|
165
|
-
let
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
}
|
172
|
-
;
|
152
|
+
let json = {
|
153
|
+
paths: {
|
154
|
+
source: {},
|
155
|
+
output: {},
|
156
|
+
},
|
157
|
+
};
|
173
158
|
|
174
159
|
// add components
|
175
160
|
if (answers.components) {
|
@@ -191,7 +176,7 @@ module.exports = {
|
|
191
176
|
json.base = path.normalize(answers.semanticRoot);
|
192
177
|
}
|
193
178
|
|
194
|
-
// record version number to avoid re-installing on same version
|
179
|
+
// record version number to avoid re-installing on the same version
|
195
180
|
json.version = release.version;
|
196
181
|
|
197
182
|
// add dist folder paths
|
@@ -256,7 +241,6 @@ module.exports = {
|
|
256
241
|
config: 'semantic.json',
|
257
242
|
overridesImport: 'src/overrides.less',
|
258
243
|
lessImport: 'src/semantic.less',
|
259
|
-
site: 'src/site',
|
260
244
|
themeConfig: 'src/theme.config',
|
261
245
|
themeImport: 'src/theme.less',
|
262
246
|
},
|
@@ -751,20 +735,18 @@ module.exports = {
|
|
751
735
|
},
|
752
736
|
|
753
737
|
/* Copy Install Folders */
|
754
|
-
|
738
|
+
copy: {
|
755
739
|
|
756
|
-
// overwrite existing files update
|
740
|
+
// overwrite existing files update and install (default theme / definition)
|
757
741
|
overwrite: {
|
758
|
-
|
759
|
-
|
760
|
-
preserveFiles: false,
|
742
|
+
overwrite: true,
|
743
|
+
preserveTimestamps: true,
|
761
744
|
},
|
762
745
|
|
763
746
|
// only create files that don't exist (site theme update)
|
764
747
|
merge: {
|
765
|
-
|
766
|
-
|
767
|
-
preserveFiles: true,
|
748
|
+
overwrite: false,
|
749
|
+
preserveTimestamps: true,
|
768
750
|
},
|
769
751
|
|
770
752
|
},
|
@@ -4,14 +4,12 @@
|
|
4
4
|
|
5
5
|
const requireDotFile = require('require-dot-file');
|
6
6
|
|
7
|
-
let
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
includeVersionInFileName
|
14
|
-
;
|
7
|
+
let config;
|
8
|
+
let npmPackage;
|
9
|
+
let version;
|
10
|
+
let revision;
|
11
|
+
let versionInFileName;
|
12
|
+
let includeVersionInFileName;
|
15
13
|
|
16
14
|
/*******************************
|
17
15
|
Derived Values
|
@@ -29,7 +27,7 @@ try {
|
|
29
27
|
};
|
30
28
|
}
|
31
29
|
|
32
|
-
// looks for version in config or package.json (whichever is available)
|
30
|
+
// looks for the version in config or package.json (whichever is available)
|
33
31
|
version = npmPackage && npmPackage.version !== undefined && npmPackage.name === 'fomantic-ui'
|
34
32
|
? npmPackage.version
|
35
33
|
: config.version;
|
package/tasks/config/tasks.js
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
const
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
release = require('./project/release')
|
6
|
-
;
|
1
|
+
const browserslist = require('browserslist');
|
2
|
+
const console = require('@fomantic/better-console');
|
3
|
+
const config = require('./user');
|
4
|
+
const release = require('./project/release');
|
7
5
|
|
8
6
|
let defaultBrowsers = browserslist(browserslist.defaults);
|
9
7
|
let userBrowsers = browserslist();
|
@@ -18,17 +16,12 @@ if (!prefix.overrideBrowserslist && !hasBrowserslistConfig) {
|
|
18
16
|
'last 4 iOS major versions',
|
19
17
|
'last 4 Android major versions',
|
20
18
|
'last 4 ChromeAndroid versions',
|
21
|
-
'Edge 12',
|
22
|
-
'ie 11',
|
23
19
|
];
|
24
20
|
}
|
25
21
|
|
26
|
-
// Node 12 does not support ??, so a little polyfill
|
27
|
-
let nullish = (value, fallback) => (value !== undefined && value !== null ? value : fallback);
|
28
|
-
|
29
22
|
module.exports = {
|
30
23
|
|
31
|
-
banner:
|
24
|
+
banner: config.banner ?? release.banner,
|
32
25
|
|
33
26
|
log: {
|
34
27
|
created: function (file) {
|
@@ -51,7 +44,7 @@ module.exports = {
|
|
51
44
|
regExp: {
|
52
45
|
|
53
46
|
comments: {
|
54
|
-
// remove all component headers in concatenated file
|
47
|
+
// remove all component headers in the concatenated file
|
55
48
|
header: {
|
56
49
|
in: /\/\*!(?:(?!\/\*).)*# Fomantic-UI \d+\.\d+\.(?:(?!\/\*).)*MIT license(?:(?!\/\*).)*\*\/\n?/gs,
|
57
50
|
out: '',
|
@@ -63,7 +56,7 @@ module.exports = {
|
|
63
56
|
out: '$1',
|
64
57
|
},
|
65
58
|
|
66
|
-
// add version to first comment
|
59
|
+
// add the version to the first comment
|
67
60
|
license: {
|
68
61
|
in: /(^\/\*[\S\s]+)(# Fomantic-UI )([\S\s]+?\*\/)/,
|
69
62
|
out: '$1$2' + release.version + ' $3',
|
@@ -90,33 +83,26 @@ module.exports = {
|
|
90
83
|
|
91
84
|
settings: {
|
92
85
|
|
93
|
-
/* Remove Files in Clean */
|
94
|
-
del: {
|
95
|
-
silent: true,
|
96
|
-
},
|
97
|
-
|
98
86
|
concatCSS: {
|
99
87
|
rebaseUrls: false,
|
100
88
|
},
|
101
89
|
|
102
90
|
/* Comment Banners */
|
103
91
|
header: {
|
104
|
-
year:
|
105
|
-
title:
|
106
|
-
version:
|
107
|
-
repository:
|
108
|
-
url:
|
92
|
+
year: config.header.year ?? new Date().getFullYear(),
|
93
|
+
title: config.header.title ?? release.title,
|
94
|
+
version: config.header.version ?? release.version,
|
95
|
+
repository: config.header.repository ?? release.repository,
|
96
|
+
url: config.header.url ?? release.url,
|
109
97
|
},
|
110
98
|
|
111
99
|
plumber: {
|
112
100
|
less: {
|
113
101
|
errorHandler: function (error) {
|
114
|
-
let
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
element
|
119
|
-
;
|
102
|
+
let regExp = {
|
103
|
+
variable: /@(\S.*?)\s/,
|
104
|
+
};
|
105
|
+
let element;
|
120
106
|
if (error && error.filename && /theme.less/.test(error.filename)) {
|
121
107
|
if (error.line === 9) {
|
122
108
|
element = regExp.variable.exec(error.message)[1];
|
package/tasks/config/user.js
CHANGED
@@ -2,32 +2,26 @@
|
|
2
2
|
Set-up
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
let
|
18
|
-
// Final config object
|
19
|
-
gulpConfig = {},
|
20
|
-
|
21
|
-
// semantic.json settings
|
22
|
-
userConfig
|
23
|
-
;
|
5
|
+
// npm dependencies
|
6
|
+
const extend = require('extend');
|
7
|
+
const requireDotFile = require('require-dot-file');
|
8
|
+
|
9
|
+
// semantic.json defaults
|
10
|
+
const defaults = require('./defaults');
|
11
|
+
const config = require('./project/config');
|
12
|
+
|
13
|
+
// Final config object
|
14
|
+
let gulpConfig;
|
15
|
+
|
16
|
+
// semantic.json settings
|
17
|
+
let userConfig;
|
24
18
|
|
25
19
|
/*******************************
|
26
20
|
User Config
|
27
21
|
*******************************/
|
28
22
|
|
29
23
|
try {
|
30
|
-
// looks for config file across all parent directories
|
24
|
+
// looks for a config file across all parent directories
|
31
25
|
userConfig = requireDotFile('semantic.json', process.cwd());
|
32
26
|
if (userConfig.valueOf() === false) {
|
33
27
|
console.error('No semantic.json config found');
|
package/tasks/docs/build.js
CHANGED
@@ -2,37 +2,35 @@
|
|
2
2
|
Build Docs
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
const
|
6
|
-
|
7
|
-
extend = require('extend'),
|
5
|
+
const fs = require('node:fs');
|
6
|
+
const extend = require('extend');
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
// node dependencies
|
9
|
+
const console = require('@fomantic/better-console');
|
10
|
+
const gulp = require('gulp');
|
11
|
+
const map = require('map-stream');
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
// gulp dependencies
|
14
|
+
const print = require('gulp-print').default;
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
// user config
|
17
|
+
const configDocs = require('../config/docs');
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
// install config
|
20
|
+
const tasks = require('../config/tasks');
|
21
|
+
const configSetup = require('../config/project/config');
|
22
|
+
const install = require('../config/project/install');
|
24
23
|
|
25
|
-
|
26
|
-
|
24
|
+
// metadata parsing
|
25
|
+
const metadata = require('./metadata');
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
// build methods
|
28
|
+
const buildJS = require('../build/javascript').buildJS;
|
29
|
+
const buildCSS = require('../build/css').buildCSS;
|
30
|
+
const buildAssets = require('../build/assets').buildAssets;
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
;
|
32
|
+
// shorthand
|
33
|
+
const log = tasks.log;
|
36
34
|
|
37
35
|
module.exports = function (callback) {
|
38
36
|
// use a different config
|
@@ -40,7 +38,7 @@ module.exports = function (callback) {
|
|
40
38
|
configSetup.addDerivedValues(config);
|
41
39
|
|
42
40
|
// shorthand
|
43
|
-
const globs
|
41
|
+
const globs = config.globs;
|
44
42
|
const output = config.paths.output;
|
45
43
|
|
46
44
|
/* --------------
|
@@ -59,8 +57,7 @@ module.exports = function (callback) {
|
|
59
57
|
.on('end', function () {
|
60
58
|
fs.mkdirSync(output.metadata, { recursive: true });
|
61
59
|
fs.writeFileSync(output.metadata + '/metadata.json', JSON.stringify(metadata.result, null, 2));
|
62
|
-
})
|
63
|
-
;
|
60
|
+
});
|
64
61
|
}
|
65
62
|
|
66
63
|
/* --------------
|
@@ -73,8 +70,7 @@ module.exports = function (callback) {
|
|
73
70
|
|
74
71
|
return gulp.src('examples/**/*.*', { encoding: false })
|
75
72
|
.pipe(gulp.dest(output.examples))
|
76
|
-
.pipe(print(log.created))
|
77
|
-
;
|
73
|
+
.pipe(print(log.created));
|
78
74
|
}
|
79
75
|
|
80
76
|
/* --------------
|
@@ -87,8 +83,7 @@ module.exports = function (callback) {
|
|
87
83
|
|
88
84
|
return gulp.src('src/**/*.*', { encoding: false })
|
89
85
|
.pipe(gulp.dest(output.less))
|
90
|
-
.pipe(print(log.created))
|
91
|
-
;
|
86
|
+
.pipe(print(log.created));
|
92
87
|
}
|
93
88
|
|
94
89
|
/* --------------
|
package/tasks/docs/metadata.js
CHANGED
@@ -2,12 +2,10 @@
|
|
2
2
|
Summarize Docs
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
YAML = require('yamljs')
|
10
|
-
;
|
5
|
+
// node dependencies
|
6
|
+
const console = require('@fomantic/better-console');
|
7
|
+
const path = require('node:path');
|
8
|
+
const YAML = require('js-yaml');
|
11
9
|
|
12
10
|
let data = {};
|
13
11
|
|
@@ -33,7 +31,7 @@ function inArray(needle, haystack) {
|
|
33
31
|
}
|
34
32
|
|
35
33
|
/**
|
36
|
-
* Parses a file for metadata and stores result in data object.
|
34
|
+
* Parses a file for metadata and stores result in a data object.
|
37
35
|
* @param {File} file - object provided by map-stream.
|
38
36
|
* @param {function(?,File)} - callback provided by map-stream to
|
39
37
|
* reply when done.
|
@@ -49,14 +47,12 @@ function parser(file, callback) {
|
|
49
47
|
}
|
50
48
|
|
51
49
|
try {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
position = filename.indexOf(key)
|
59
|
-
;
|
50
|
+
/** @type {string} */
|
51
|
+
let text = String(file.contents.toString('utf8'));
|
52
|
+
let lines = text.split('\n');
|
53
|
+
let filename = file.path.slice(0, -4);
|
54
|
+
let key = 'server' + path.sep + 'documents';
|
55
|
+
let position = filename.indexOf(key);
|
60
56
|
|
61
57
|
// exit conditions
|
62
58
|
if (!lines) {
|
@@ -66,24 +62,22 @@ function parser(file, callback) {
|
|
66
62
|
return callback(null, file);
|
67
63
|
}
|
68
64
|
|
69
|
-
filename = filename.slice(position + key.length + 1, filename.length);
|
70
|
-
|
71
|
-
let
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
line
|
86
|
-
;
|
65
|
+
filename = filename.slice(position + key.length + 1, filename.length).replaceAll(path.win32.sep, path.posix.sep);
|
66
|
+
|
67
|
+
let lineCount = lines.length;
|
68
|
+
let active = false;
|
69
|
+
let yaml = [];
|
70
|
+
let categories = [
|
71
|
+
'UI Element',
|
72
|
+
'UI Global',
|
73
|
+
'UI Collection',
|
74
|
+
'UI View',
|
75
|
+
'UI Module',
|
76
|
+
'UI Behavior',
|
77
|
+
];
|
78
|
+
let index;
|
79
|
+
let meta;
|
80
|
+
let line;
|
87
81
|
|
88
82
|
for (index = 0; index < lineCount; index++) {
|
89
83
|
line = lines[index];
|
@@ -104,16 +98,13 @@ function parser(file, callback) {
|
|
104
98
|
}
|
105
99
|
|
106
100
|
// Parse yaml.
|
107
|
-
meta = YAML.
|
101
|
+
meta = YAML.load(yaml.join('\n'));
|
108
102
|
if (meta && meta.type && meta.title && inArray(meta.type, categories)) {
|
109
103
|
meta.category = meta.type;
|
110
104
|
meta.filename = filename;
|
111
105
|
meta.url = '/' + filename;
|
112
|
-
// Primary key will
|
113
|
-
data[meta.element] = meta;
|
114
|
-
} else {
|
115
|
-
// skip
|
116
|
-
// console.log(meta);
|
106
|
+
// Primary key will be filepath
|
107
|
+
data[meta.element.toLowerCase()] = meta;
|
117
108
|
}
|
118
109
|
} catch (error) {
|
119
110
|
console.log(error, file.path);
|
package/tasks/docs/serve.js
CHANGED
@@ -2,32 +2,30 @@
|
|
2
2
|
Serve Docs
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
const
|
6
|
-
extend = require('extend'),
|
5
|
+
const extend = require('extend');
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
// node dependencies
|
8
|
+
const console = require('@fomantic/better-console');
|
9
|
+
const gulp = require('gulp');
|
11
10
|
|
12
|
-
|
13
|
-
|
11
|
+
// gulp dependencies
|
12
|
+
const print = require('gulp-print').default;
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
// user config
|
15
|
+
const configDocs = require('../config/docs');
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
// task config
|
18
|
+
const tasks = require('../config/tasks');
|
19
|
+
const configSetup = require('../config/project/config');
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
// shorthand
|
22
|
+
const log = tasks.log;
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
;
|
24
|
+
const css = require('../build/css');
|
25
|
+
const js = require('../build/javascript');
|
26
|
+
const assets = require('../build/assets');
|
29
27
|
|
30
|
-
module.exports = function () {
|
28
|
+
module.exports = function (callback) {
|
31
29
|
// use a different config
|
32
30
|
const config = extend(true, {}, configDocs);
|
33
31
|
configSetup.addDerivedValues(config);
|
@@ -52,10 +50,8 @@ module.exports = function () {
|
|
52
50
|
encoding: false,
|
53
51
|
})
|
54
52
|
.pipe(gulp.dest(config.paths.output.less))
|
55
|
-
.pipe(print(log.created))
|
56
|
-
|
57
|
-
})
|
58
|
-
;
|
53
|
+
.pipe(print(log.created));
|
54
|
+
});
|
59
55
|
|
60
56
|
/* --------------
|
61
57
|
Copy Examples
|
@@ -74,10 +70,8 @@ module.exports = function () {
|
|
74
70
|
encoding: false,
|
75
71
|
})
|
76
72
|
.pipe(gulp.dest(config.paths.output.examples))
|
77
|
-
.pipe(print(log.created))
|
78
|
-
|
79
|
-
})
|
80
|
-
;
|
73
|
+
.pipe(print(log.created));
|
74
|
+
});
|
81
75
|
|
82
76
|
/* --------------
|
83
77
|
Watch CSS
|
@@ -96,4 +90,6 @@ module.exports = function () {
|
|
96
90
|
--------------- */
|
97
91
|
|
98
92
|
assets.watch('docs', config);
|
93
|
+
|
94
|
+
callback();
|
99
95
|
};
|