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
package/tasks/install.js
CHANGED
@@ -9,56 +9,45 @@
|
|
9
9
|
|
10
10
|
* (NPM) Install - Will ask for where to put fomantic (outside pm folder)
|
11
11
|
* (NPM) Upgrade - Will look for fomantic install, copy over files and update if new version
|
12
|
-
* Standard installer runs asking for paths to site files etc
|
12
|
+
* Standard installer runs asking for paths to site files etc.
|
13
13
|
*/
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
// shorthand
|
45
|
-
questions = install.questions,
|
46
|
-
files = install.files,
|
47
|
-
folders = install.folders,
|
48
|
-
regExp = install.regExp,
|
49
|
-
settings = install.settings,
|
50
|
-
source = install.source
|
51
|
-
;
|
15
|
+
// node dependencies
|
16
|
+
const fs = require('fs-extra');
|
17
|
+
const path = require('node:path');
|
18
|
+
const extend = require('extend');
|
19
|
+
const console = require('@fomantic/better-console');
|
20
|
+
const gulp = require('gulp');
|
21
|
+
|
22
|
+
// gulp dependencies
|
23
|
+
const jsonEditor = require('gulp-json-editor');
|
24
|
+
const plumber = require('@fomantic/gulp-plumber');
|
25
|
+
const inquirer = require('inquirer');
|
26
|
+
const rename = require('gulp-rename');
|
27
|
+
const replace = require('gulp-replace');
|
28
|
+
const requireDotFile = require('require-dot-file');
|
29
|
+
|
30
|
+
// install config
|
31
|
+
const install = require('./config/project/install');
|
32
|
+
|
33
|
+
// release config (name/title/etc)
|
34
|
+
const release = require('./config/project/release');
|
35
|
+
|
36
|
+
// shorthand
|
37
|
+
const questions = install.questions;
|
38
|
+
const files = install.files;
|
39
|
+
const folders = install.folders;
|
40
|
+
const regExp = install.regExp;
|
41
|
+
const settings = install.settings;
|
42
|
+
const source = install.source;
|
52
43
|
|
53
44
|
// Export install task
|
54
45
|
module.exports = function (callback) {
|
55
|
-
let
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
answers
|
61
|
-
;
|
46
|
+
let currentConfig = requireDotFile('semantic.json', process.cwd());
|
47
|
+
let manager = install.getPackageManager();
|
48
|
+
let rootQuestions = questions.root;
|
49
|
+
let installFolder = false;
|
50
|
+
let answers;
|
62
51
|
|
63
52
|
console.clear();
|
64
53
|
|
@@ -76,7 +65,7 @@ module.exports = function (callback) {
|
|
76
65
|
return;
|
77
66
|
}
|
78
67
|
|
79
|
-
if (!fs.
|
68
|
+
if (!fs.pathExistsSync(source.site)) {
|
80
69
|
console.log('Missing _site folder. \u001B[92mgulp install\u001B[0m must run inside \u001B[92mnode_modules' + path.sep + 'fomantic-ui\u001B[0m');
|
81
70
|
console.error('Aborting.');
|
82
71
|
callback();
|
@@ -90,55 +79,50 @@ module.exports = function (callback) {
|
|
90
79
|
|
91
80
|
// run update scripts if semantic.json exists
|
92
81
|
if (currentConfig && manager.name === 'NPM') {
|
93
|
-
let
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
}
|
105
|
-
;
|
82
|
+
let updateFolder = path.join(manager.root, currentConfig.base);
|
83
|
+
let updatePaths = {
|
84
|
+
config: path.join(manager.root, files.config),
|
85
|
+
tasks: path.join(updateFolder, folders.tasks),
|
86
|
+
overridesImport: path.join(updateFolder, folders.overridesImport),
|
87
|
+
themeImport: path.join(updateFolder, folders.themeImport),
|
88
|
+
definition: path.join(currentConfig.paths.source.definitions),
|
89
|
+
site: path.join(currentConfig.paths.source.site),
|
90
|
+
theme: path.join(currentConfig.paths.source.themes),
|
91
|
+
defaultTheme: path.join(currentConfig.paths.source.themes, folders.defaultTheme),
|
92
|
+
};
|
106
93
|
|
107
94
|
// duck-type if there is a project installed
|
108
|
-
if (fs.
|
95
|
+
if (fs.pathExistsSync(updatePaths.definition)) {
|
109
96
|
// perform update if new version
|
110
97
|
if (currentConfig.version !== release.version) {
|
111
98
|
console.log('Updating Fomantic UI from ' + currentConfig.version + ' to ' + release.version);
|
112
99
|
|
113
100
|
console.info('Updating ui definitions...');
|
114
|
-
|
101
|
+
fs.copySync(source.definitions, updatePaths.definition, settings.copy.overwrite);
|
115
102
|
|
116
103
|
console.info('Updating default theme...');
|
117
|
-
|
118
|
-
|
104
|
+
fs.copySync(source.themes, updatePaths.theme, settings.copy.merge);
|
105
|
+
fs.copySync(source.defaultTheme, updatePaths.defaultTheme, settings.copy.overwrite);
|
119
106
|
|
120
107
|
console.info('Updating tasks...');
|
121
|
-
|
108
|
+
fs.copySync(source.tasks, updatePaths.tasks, settings.copy.overwrite);
|
122
109
|
|
123
110
|
console.info('Updating gulpfile.js');
|
124
111
|
gulp.src(source.userGulpFile)
|
125
112
|
.pipe(plumber())
|
126
|
-
.pipe(gulp.dest(updateFolder))
|
127
|
-
;
|
113
|
+
.pipe(gulp.dest(updateFolder));
|
128
114
|
|
129
115
|
// copy theme import
|
130
116
|
console.info('Updating theme import file');
|
131
117
|
gulp.src(source.themeImport)
|
132
118
|
.pipe(plumber())
|
133
|
-
.pipe(gulp.dest(updatePaths.themeImport))
|
134
|
-
;
|
119
|
+
.pipe(gulp.dest(updatePaths.themeImport));
|
135
120
|
console.info('Updating overrides import file');
|
136
121
|
gulp.src(source.overridesImport)
|
137
122
|
.pipe(plumber())
|
138
|
-
.pipe(gulp.dest(updatePaths.overridesImport))
|
139
|
-
;
|
123
|
+
.pipe(gulp.dest(updatePaths.overridesImport));
|
140
124
|
console.info('Adding new site theme files...');
|
141
|
-
|
125
|
+
fs.copySync(source.site, updatePaths.site, settings.copy.merge);
|
142
126
|
|
143
127
|
console.info('Updating version...');
|
144
128
|
|
@@ -149,8 +133,7 @@ module.exports = function (callback) {
|
|
149
133
|
.pipe(jsonEditor({
|
150
134
|
version: release.version,
|
151
135
|
}))
|
152
|
-
.pipe(gulp.dest(manager.root))
|
153
|
-
;
|
136
|
+
.pipe(gulp.dest(manager.root));
|
154
137
|
|
155
138
|
console.info('Update complete! Run "\u001B[92mgulp build\u001B[0m" to rebuild dist/ files.');
|
156
139
|
|
@@ -177,9 +160,8 @@ module.exports = function (callback) {
|
|
177
160
|
if (manager.name === 'NPM') {
|
178
161
|
rootQuestions[0].message = rootQuestions[0].message
|
179
162
|
.replace('{packageMessage}', 'We detected you are using ' + manager.name + ' Nice!')
|
180
|
-
.replace('{root}', manager.root)
|
181
|
-
|
182
|
-
// set default path to detected PM root
|
163
|
+
.replace('{root}', manager.root);
|
164
|
+
// set default path to the detected PM root
|
183
165
|
rootQuestions[0].default = manager.root;
|
184
166
|
rootQuestions[1].default = manager.root;
|
185
167
|
|
@@ -209,8 +191,7 @@ module.exports = function (callback) {
|
|
209
191
|
.then((setupAnswers) => {
|
210
192
|
// hoist
|
211
193
|
answers = setupAnswers;
|
212
|
-
})
|
213
|
-
;
|
194
|
+
});
|
214
195
|
}
|
215
196
|
});
|
216
197
|
|
@@ -237,15 +218,13 @@ module.exports = function (callback) {
|
|
237
218
|
Paths
|
238
219
|
--------------- */
|
239
220
|
|
240
|
-
let
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
}
|
248
|
-
;
|
221
|
+
let installPaths = {
|
222
|
+
config: files.config,
|
223
|
+
configFolder: folders.config,
|
224
|
+
site: answers.site || folders.site,
|
225
|
+
themeConfig: files.themeConfig,
|
226
|
+
themeConfigFolder: folders.themeConfig,
|
227
|
+
};
|
249
228
|
|
250
229
|
/* --------------
|
251
230
|
NPM Install
|
@@ -253,7 +232,7 @@ module.exports = function (callback) {
|
|
253
232
|
|
254
233
|
// Check if PM install
|
255
234
|
if (manager && (answers.useRoot || answers.customRoot)) {
|
256
|
-
// Set root to custom root path if set
|
235
|
+
// Set root to the custom root path if set
|
257
236
|
if (answers.customRoot) {
|
258
237
|
if (answers.customRoot === '') {
|
259
238
|
console.log('Unable to proceed, invalid project root');
|
@@ -290,10 +269,10 @@ module.exports = function (callback) {
|
|
290
269
|
|
291
270
|
// create project folders
|
292
271
|
try {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
272
|
+
fs.mkdirpSync(installFolder);
|
273
|
+
fs.mkdirpSync(installPaths.definition);
|
274
|
+
fs.mkdirpSync(installPaths.theme);
|
275
|
+
fs.mkdirpSync(installPaths.tasks);
|
297
276
|
} catch (error) {
|
298
277
|
console.error('NPM does not have permissions to create folders at your specified path. Adjust your folders permissions and run "npm install" again');
|
299
278
|
}
|
@@ -301,36 +280,32 @@ module.exports = function (callback) {
|
|
301
280
|
console.log('Installing to \u001B[92m' + answers.semanticRoot + '\u001B[0m');
|
302
281
|
|
303
282
|
console.info('Copying UI definitions');
|
304
|
-
|
283
|
+
fs.copySync(source.definitions, installPaths.definition, settings.copy.overwrite);
|
305
284
|
|
306
285
|
console.info('Copying UI themes');
|
307
|
-
|
308
|
-
|
286
|
+
fs.copySync(source.themes, installPaths.theme, settings.copy.merge);
|
287
|
+
fs.copySync(source.defaultTheme, installPaths.defaultTheme, settings.copy.overwrite);
|
309
288
|
|
310
289
|
console.info('Copying gulp tasks');
|
311
|
-
|
290
|
+
fs.copySync(source.tasks, installPaths.tasks, settings.copy.overwrite);
|
312
291
|
|
313
292
|
// copy theme import
|
314
293
|
console.info('Adding theme files');
|
315
294
|
gulp.src(source.themeImport)
|
316
295
|
.pipe(plumber())
|
317
|
-
.pipe(gulp.dest(installPaths.themeImport))
|
318
|
-
;
|
296
|
+
.pipe(gulp.dest(installPaths.themeImport));
|
319
297
|
gulp.src(source.overridesImport)
|
320
298
|
.pipe(plumber())
|
321
|
-
.pipe(gulp.dest(installPaths.overridesImport))
|
322
|
-
;
|
299
|
+
.pipe(gulp.dest(installPaths.overridesImport));
|
323
300
|
gulp.src(source.lessImport)
|
324
301
|
.pipe(plumber())
|
325
|
-
.pipe(gulp.dest(installPaths.lessImport))
|
326
|
-
;
|
302
|
+
.pipe(gulp.dest(installPaths.lessImport));
|
327
303
|
|
328
304
|
// create gulp file
|
329
305
|
console.info('Creating gulpfile.js');
|
330
306
|
gulp.src(source.userGulpFile)
|
331
307
|
.pipe(plumber())
|
332
|
-
.pipe(gulp.dest(installFolder))
|
333
|
-
;
|
308
|
+
.pipe(gulp.dest(installFolder));
|
334
309
|
}
|
335
310
|
|
336
311
|
/* --------------
|
@@ -338,36 +313,33 @@ module.exports = function (callback) {
|
|
338
313
|
--------------- */
|
339
314
|
|
340
315
|
// Copy _site templates folder to destination
|
341
|
-
if (fs.
|
316
|
+
if (fs.pathExistsSync(installPaths.site)) {
|
342
317
|
console.info('Site folder exists, merging files (no overwrite)', installPaths.site);
|
343
318
|
} else {
|
344
319
|
console.info('Creating site theme folder', installPaths.site);
|
345
320
|
}
|
346
|
-
|
321
|
+
fs.copySync(source.site, installPaths.site, settings.copy.merge);
|
347
322
|
|
348
323
|
/* --------------
|
349
324
|
Theme Config
|
350
325
|
--------------- */
|
351
326
|
|
352
327
|
gulp.task('create theme.config', function () {
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
siteVariable = "@siteFolder: '" + pathToSite + "/';"
|
358
|
-
;
|
328
|
+
// determine path to site theme folder from theme config
|
329
|
+
// force CSS path variable to use forward slashes for paths
|
330
|
+
let pathToSite = path.relative(path.resolve(installPaths.themeConfigFolder), path.resolve(installPaths.site)).replace(/\\/g, '/');
|
331
|
+
let siteVariable = "@siteFolder: '" + pathToSite + "/';";
|
359
332
|
|
360
333
|
// rewrite site variable in theme.less
|
361
334
|
console.info('Adjusting @siteFolder to:', pathToSite + '/');
|
362
335
|
|
363
|
-
if (fs.
|
336
|
+
if (fs.pathExistsSync(installPaths.themeConfig)) {
|
364
337
|
console.info('Modifying src/theme.config (LESS config)', installPaths.themeConfig);
|
365
338
|
|
366
339
|
return gulp.src(installPaths.themeConfig)
|
367
340
|
.pipe(plumber())
|
368
341
|
.pipe(replace(regExp.siteVariable, siteVariable))
|
369
|
-
.pipe(gulp.dest(installPaths.themeConfigFolder))
|
370
|
-
;
|
342
|
+
.pipe(gulp.dest(installPaths.themeConfigFolder));
|
371
343
|
}
|
372
344
|
|
373
345
|
console.info('Creating src/theme.config (LESS config)', installPaths.themeConfig);
|
@@ -376,8 +348,7 @@ module.exports = function (callback) {
|
|
376
348
|
.pipe(plumber())
|
377
349
|
.pipe(rename({ extname: '' }))
|
378
350
|
.pipe(replace(regExp.siteVariable, siteVariable))
|
379
|
-
.pipe(gulp.dest(installPaths.themeConfigFolder))
|
380
|
-
;
|
351
|
+
.pipe(gulp.dest(installPaths.themeConfigFolder));
|
381
352
|
});
|
382
353
|
|
383
354
|
/* --------------
|
@@ -385,20 +356,17 @@ module.exports = function (callback) {
|
|
385
356
|
--------------- */
|
386
357
|
|
387
358
|
gulp.task('create semantic.json', function () {
|
388
|
-
let
|
389
|
-
jsonConfig = install.createJSON(answers)
|
390
|
-
;
|
359
|
+
let jsonConfig = install.createJSON(answers);
|
391
360
|
|
392
361
|
// adjust variables in theme.less
|
393
|
-
if (fs.
|
362
|
+
if (fs.pathExistsSync(installPaths.config)) {
|
394
363
|
console.info('Extending config file (semantic.json)', installPaths.config);
|
395
364
|
|
396
365
|
return gulp.src(installPaths.config)
|
397
366
|
.pipe(plumber())
|
398
367
|
.pipe(rename(settings.rename.json)) // preserve file extension
|
399
368
|
.pipe(jsonEditor(jsonConfig))
|
400
|
-
.pipe(gulp.dest(installPaths.configFolder))
|
401
|
-
;
|
369
|
+
.pipe(gulp.dest(installPaths.configFolder));
|
402
370
|
}
|
403
371
|
|
404
372
|
console.info('Creating config file (semantic.json)', installPaths.config);
|
@@ -407,8 +375,7 @@ module.exports = function (callback) {
|
|
407
375
|
.pipe(plumber())
|
408
376
|
.pipe(rename({ extname: '' })) // remove .template from ext
|
409
377
|
.pipe(jsonEditor(jsonConfig, { end_with_newline: true }))
|
410
|
-
.pipe(gulp.dest(installPaths.configFolder))
|
411
|
-
;
|
378
|
+
.pipe(gulp.dest(installPaths.configFolder));
|
412
379
|
});
|
413
380
|
|
414
381
|
gulp.series('create theme.config', 'create semantic.json')(callback);
|
@@ -431,15 +398,14 @@ module.exports = function (callback) {
|
|
431
398
|
inquirer.prompt(questions.cleanup)
|
432
399
|
.then((answers) => {
|
433
400
|
if (answers.cleanup === 'yes') {
|
434
|
-
|
401
|
+
install.setupFiles.forEach((file) => fs.removeSync(file));
|
435
402
|
}
|
436
403
|
if (answers.build === 'yes') {
|
437
404
|
gulp.series('build')(callback);
|
438
405
|
} else {
|
439
406
|
callback();
|
440
407
|
}
|
441
|
-
})
|
442
|
-
;
|
408
|
+
});
|
443
409
|
}
|
444
410
|
}
|
445
411
|
});
|
package/tasks/rtl/build.js
CHANGED
@@ -2,10 +2,8 @@
|
|
2
2
|
* Build Task
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
const
|
6
|
-
|
7
|
-
build = require('../build')
|
8
|
-
;
|
5
|
+
const gulp = require('gulp');
|
6
|
+
const build = require('../build');
|
9
7
|
|
10
8
|
// RTL builds are now handled by the default build process
|
11
9
|
module.exports = function (callback) {
|
package/tasks/rtl/watch.js
CHANGED
@@ -2,12 +2,10 @@
|
|
2
2
|
* Watch Task
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
const
|
6
|
-
|
7
|
-
watch = require('../watch')
|
8
|
-
;
|
5
|
+
const gulp = require('gulp');
|
6
|
+
const watch = require('../watch');
|
9
7
|
|
10
|
-
// RTL watch
|
8
|
+
// RTL watch is now handled by the default watch process
|
11
9
|
module.exports = function (callback) {
|
12
10
|
gulp.series(watch)(callback);
|
13
11
|
};
|
package/tasks/watch.js
CHANGED
@@ -2,26 +2,24 @@
|
|
2
2
|
* Watch Task
|
3
3
|
*******************************/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
console = require('@fomantic/better-console'),
|
8
|
-
gulp = require('gulp'),
|
5
|
+
// node dependencies
|
6
|
+
const console = require('@fomantic/better-console');
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
// user config
|
9
|
+
const config = require('./config/user');
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
// task config
|
12
|
+
const install = require('./config/project/install');
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
;
|
14
|
+
const css = require('./build/css');
|
15
|
+
const js = require('./build/javascript');
|
16
|
+
const assets = require('./build/assets');
|
20
17
|
|
21
18
|
// export task
|
22
|
-
module.exports = function () {
|
19
|
+
module.exports = function (callback) {
|
23
20
|
if (!install.isSetup()) {
|
24
21
|
console.error('Cannot watch files. Run "gulp install" to set-up Fomantic');
|
22
|
+
callback();
|
25
23
|
|
26
24
|
return;
|
27
25
|
}
|
@@ -45,4 +43,6 @@ module.exports = function () {
|
|
45
43
|
--------------- */
|
46
44
|
|
47
45
|
assets.watch('default', config);
|
46
|
+
|
47
|
+
callback();
|
48
48
|
};
|
package/test/meteor/fonts.js
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
function moduleTests(ui) {
|
2
|
-
let
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
$clone
|
16
|
-
;
|
2
|
+
let module = ui.module;
|
3
|
+
let element = ui.element;
|
4
|
+
let singleton = ui.singleton;
|
5
|
+
let name = $.fn[module].settings.name;
|
6
|
+
|
7
|
+
let testValue = 'Test';
|
8
|
+
let fixtures = jasmine.getFixtures(); // eslint-disable-line jest/no-jasmine-globals
|
9
|
+
|
10
|
+
let originalSettings;
|
11
|
+
let $modules;
|
12
|
+
let $oneModule;
|
13
|
+
let $module;
|
14
|
+
let $clone;
|
17
15
|
|
18
16
|
// set fixture path
|
19
17
|
fixtures.fixturesPath = 'base/test/fixtures/';
|
@@ -138,7 +136,7 @@ function moduleTests(ui) {
|
|
138
136
|
$modules[module]('setting', 'name', testValue);
|
139
137
|
|
140
138
|
let retrievedValue = $oneModule[module]('setting', 'name');
|
141
|
-
let clonedSetting
|
139
|
+
let clonedSetting = $clone[module]('setting', 'name');
|
142
140
|
|
143
141
|
expect(retrievedValue).toBe(testValue);
|
144
142
|
expect(clonedSetting).toBe(testValue);
|
@@ -156,7 +154,7 @@ function moduleTests(ui) {
|
|
156
154
|
$oneModule[module]('setting', 'name', testValue);
|
157
155
|
|
158
156
|
let retrievedValue = $oneModule[module]('setting', 'name');
|
159
|
-
let clonedSetting
|
157
|
+
let clonedSetting = $clone[module]('setting', 'name');
|
160
158
|
|
161
159
|
expect(retrievedValue).toBe(testValue);
|
162
160
|
expect(clonedSetting).toBe(name);
|
@@ -170,7 +168,7 @@ function moduleTests(ui) {
|
|
170
168
|
});
|
171
169
|
|
172
170
|
let retrievedValue = $oneModule[module]('setting', 'name');
|
173
|
-
let clonedSetting
|
171
|
+
let clonedSetting = $clone[module]('setting', 'name');
|
174
172
|
|
175
173
|
expect(retrievedValue).toBe(testValue);
|
176
174
|
expect(clonedSetting).toBe(name);
|
@@ -350,7 +350,7 @@ declare namespace FomanticUI {
|
|
350
350
|
/**
|
351
351
|
* Whether HTML included in dropdown values should be preserved.
|
352
352
|
* Allows icons to show up in selected value.
|
353
|
-
* @default
|
353
|
+
* @default false
|
354
354
|
*/
|
355
355
|
preserveHTML: boolean;
|
356
356
|
|
@@ -500,6 +500,12 @@ declare namespace FomanticUI {
|
|
500
500
|
|
501
501
|
// endregion
|
502
502
|
|
503
|
+
// region Template Settings
|
504
|
+
|
505
|
+
templates: Dropdown.TemplateSettings;
|
506
|
+
|
507
|
+
// endregion
|
508
|
+
|
503
509
|
// region Callbacks
|
504
510
|
|
505
511
|
/**
|
@@ -647,6 +653,7 @@ declare namespace FomanticUI {
|
|
647
653
|
}
|
648
654
|
|
649
655
|
namespace Dropdown {
|
656
|
+
type TemplateSettings = Partial<Pick<Settings.Templates, keyof Settings.Templates>>;
|
650
657
|
type TransitionSettings = Partial<Pick<Settings.Transition, keyof Settings.Transition>>;
|
651
658
|
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
652
659
|
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
@@ -658,6 +665,43 @@ declare namespace FomanticUI {
|
|
658
665
|
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
659
666
|
|
660
667
|
namespace Settings {
|
668
|
+
interface Templates {
|
669
|
+
/**
|
670
|
+
* @default function(string, settings)
|
671
|
+
*/
|
672
|
+
escape: (string: string, settings?: DropdownSettings) => string;
|
673
|
+
|
674
|
+
/**
|
675
|
+
* generates dropdown from select values
|
676
|
+
* @default function(message, type, header)
|
677
|
+
*/
|
678
|
+
dropdown: (select: {placeholder?: string, values: {[key: string]: string}}, settings: DropdownSettings) => string;
|
679
|
+
|
680
|
+
/**
|
681
|
+
* generates just menu from select
|
682
|
+
* @default function(response, settings)
|
683
|
+
*/
|
684
|
+
menu: (values: {[key: string]: string}, settings: DropdownSettings) => string;
|
685
|
+
|
686
|
+
/**
|
687
|
+
* generates label for multiselect
|
688
|
+
* @default function(response, settings)
|
689
|
+
*/
|
690
|
+
label: (value: string, text: string, settings: DropdownSettings) => string;
|
691
|
+
|
692
|
+
/**
|
693
|
+
* generates messages like "No results"
|
694
|
+
* @default function(response, settings)
|
695
|
+
*/
|
696
|
+
message: (message: string) => string;
|
697
|
+
|
698
|
+
/**
|
699
|
+
* generates user addition to the selection menu
|
700
|
+
* @default function(response, settings)
|
701
|
+
*/
|
702
|
+
addition: (choice: string) => string;
|
703
|
+
}
|
704
|
+
|
661
705
|
interface Transition {
|
662
706
|
|
663
707
|
/**
|
@@ -197,7 +197,7 @@ declare namespace FomanticUI {
|
|
197
197
|
/**
|
198
198
|
* Whether HTML included in given title, content or actions should be preserved.
|
199
199
|
* Set to `false` in case you work with untrusted 3rd party content.
|
200
|
-
* @default
|
200
|
+
* @default false
|
201
201
|
*/
|
202
202
|
preserveHTML: boolean;
|
203
203
|
|