@pushword/js-helper 0.0.63 → 0.0.67
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/package.json +1 -1
- package/src/encore.js +36 -29
- package/src/helpers.js +5 -5
- package/src/tailwind.helpers.js +22 -17
package/package.json
CHANGED
package/src/encore.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const WatchExternalFilesPlugin = require(
|
|
2
|
-
const Encore = require(
|
|
3
|
-
const tailwindcss = require(
|
|
1
|
+
const WatchExternalFilesPlugin = require('webpack-watch-files-plugin').default;
|
|
2
|
+
const Encore = require('@symfony/webpack-encore');
|
|
3
|
+
const tailwindcss = require('tailwindcss');
|
|
4
4
|
|
|
5
|
-
function getFilesToWatch(basePath =
|
|
5
|
+
function getFilesToWatch(basePath = './..') {
|
|
6
6
|
return [
|
|
7
|
-
basePath +
|
|
8
|
-
basePath +
|
|
9
|
-
basePath +
|
|
10
|
-
basePath +
|
|
11
|
-
basePath +
|
|
12
|
-
basePath +
|
|
13
|
-
basePath +
|
|
7
|
+
basePath + '/vendor/pushword/core/src/templates/**/*.html.twig',
|
|
8
|
+
basePath + '/vendor/pushword/core/src/templates/*.html.twig',
|
|
9
|
+
basePath + '/vendor/pushword/conversation/src/templates/*.html.twig',
|
|
10
|
+
basePath + '/vendor/pushword/admin-block-editor/src/templates/page/*.html.twig',
|
|
11
|
+
basePath + '/templates/*.html.twig',
|
|
12
|
+
basePath + '/templates/**/*.html.twig',
|
|
13
|
+
basePath + '/templates/**/**/*.html.twig',
|
|
14
14
|
];
|
|
15
15
|
}
|
|
16
16
|
function getTailwindConfig(watchFiles = null) {
|
|
17
17
|
if (watchFiles === null) watchFiles = getFilesToWatch();
|
|
18
|
-
var tailwindConfig = require(
|
|
18
|
+
var tailwindConfig = require('@pushword/js-helper/src/tailwind.config.js');
|
|
19
19
|
tailwindConfig.content = watchFiles;
|
|
20
20
|
return tailwindConfig;
|
|
21
21
|
}
|
|
@@ -24,14 +24,14 @@ module.exports = {
|
|
|
24
24
|
getFilesToWatch: getFilesToWatch,
|
|
25
25
|
getTailwindConfig: getTailwindConfig,
|
|
26
26
|
getEncore: function (
|
|
27
|
-
watchFiles = null,
|
|
28
|
-
tailwindConfig = null,
|
|
29
|
-
outputPath =
|
|
30
|
-
publicPath =
|
|
31
|
-
manifestKeyPrefix = null,
|
|
32
|
-
filesToCopy = null,
|
|
33
|
-
entries = null,
|
|
34
|
-
styleEntries = null
|
|
27
|
+
watchFiles = null, // default: getFilesToWatch()
|
|
28
|
+
tailwindConfig = null, // default : getTailwindConfig()
|
|
29
|
+
outputPath = null, // default : './../public/assets/'
|
|
30
|
+
publicPath = null, // default: '/assets'
|
|
31
|
+
manifestKeyPrefix = null, // default: null
|
|
32
|
+
filesToCopy = null, // default :: ... from: /favicons. ...
|
|
33
|
+
entries = null, // [{ name: 'app', file: '/node_modules/@pushword/js-helper/src/app.js' }];
|
|
34
|
+
styleEntries = null // [{ name: 'style', file: '/node_modules/@pushword/js-helper/src/app.css' }];
|
|
35
35
|
) {
|
|
36
36
|
if (watchFiles === null) {
|
|
37
37
|
watchFiles = getFilesToWatch();
|
|
@@ -44,24 +44,27 @@ module.exports = {
|
|
|
44
44
|
if (filesToCopy === null) {
|
|
45
45
|
filesToCopy = [
|
|
46
46
|
{
|
|
47
|
-
from:
|
|
48
|
-
to:
|
|
47
|
+
from: './favicons',
|
|
48
|
+
to: '[name].[ext]',
|
|
49
49
|
},
|
|
50
50
|
];
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (entries === null) {
|
|
54
|
-
entries = [{ name:
|
|
55
|
-
} else if (typeof entries ===
|
|
56
|
-
entries = [{ name:
|
|
54
|
+
entries = [{ name: 'app', file: __dirname + '/app.js' }];
|
|
55
|
+
} else if (typeof entries === 'string') {
|
|
56
|
+
entries = [{ name: 'app', file: entries }];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (styleEntries === null) {
|
|
60
|
-
styleEntries = [{ name:
|
|
61
|
-
} else if (typeof styleEntries ===
|
|
62
|
-
styleEntries = [{ name:
|
|
60
|
+
styleEntries = [{ name: 'style', file: __dirname + '/app.css' }];
|
|
61
|
+
} else if (typeof styleEntries === 'string') {
|
|
62
|
+
styleEntries = [{ name: 'style', file: styleEntries }];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
outputPath = outputPath ? outputPath : './../public/assets/';
|
|
66
|
+
publicPath = publicPath ? publicPath : '/assets';
|
|
67
|
+
|
|
65
68
|
Encore.setOutputPath(outputPath)
|
|
66
69
|
.setPublicPath(publicPath)
|
|
67
70
|
.cleanupOutputBeforeBuild()
|
|
@@ -75,7 +78,11 @@ module.exports = {
|
|
|
75
78
|
)
|
|
76
79
|
.enablePostCssLoader((options) => {
|
|
77
80
|
options.postcssOptions = {
|
|
78
|
-
plugins: [
|
|
81
|
+
plugins: [
|
|
82
|
+
require('postcss-import'),
|
|
83
|
+
tailwindcss(tailwindConfig),
|
|
84
|
+
require('autoprefixer'),
|
|
85
|
+
],
|
|
79
86
|
};
|
|
80
87
|
})
|
|
81
88
|
.disableSingleRuntimeChunk();
|
package/src/helpers.js
CHANGED
|
@@ -48,8 +48,8 @@ export function liveBlock(liveBlockAttribute = "data-live", liveFormSelector = "
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const spinner =
|
|
51
|
-
'<span
|
|
52
|
-
const htmlLoader = "<div>" + spinner + "</div>";
|
|
51
|
+
'<span style="border-top-color: transparent" class="inline-block w-5 h-5 border-4 border-gray-50 border-solid rounded-full animate-spin"></span>';
|
|
52
|
+
const htmlLoader = "<div>" + spinner.replace("border-gray-50", "border-gray-800") + "</div>";
|
|
53
53
|
|
|
54
54
|
var setLoader = function (form) {
|
|
55
55
|
var $submitButton = getSubmitButton(form);
|
|
@@ -285,13 +285,13 @@ export function convertFormFromRot13(attribute = "data-frot") {
|
|
|
285
285
|
|
|
286
286
|
export function convertShortchutForLink(str) {
|
|
287
287
|
if (str.charAt(0) == "-") {
|
|
288
|
-
return
|
|
288
|
+
return "http://" + str.substring(1);
|
|
289
289
|
}
|
|
290
290
|
if (str.charAt(0) == "_") {
|
|
291
|
-
return
|
|
291
|
+
return "https://" + str.substring(1);
|
|
292
292
|
}
|
|
293
293
|
if (str.charAt(0) == "@") {
|
|
294
|
-
return
|
|
294
|
+
return "mailto:" + str.substring(1);
|
|
295
295
|
}
|
|
296
296
|
return str;
|
|
297
297
|
}
|
package/src/tailwind.helpers.js
CHANGED
|
@@ -3,11 +3,16 @@ module.exports = {
|
|
|
3
3
|
return {
|
|
4
4
|
DEFAULT: {
|
|
5
5
|
css: {
|
|
6
|
-
|
|
6
|
+
a: {
|
|
7
|
+
textDecoration: 'none',
|
|
8
|
+
},
|
|
9
|
+
':where(a):not(:where([class~=not-prose] *)), :where(span[data-rot]):not(:where([class~=not-prose] *))':
|
|
7
10
|
{
|
|
8
|
-
color:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
color: 'var(--primary)',
|
|
12
|
+
fontWeight: 500,
|
|
13
|
+
borderBottom: '1px solid;',
|
|
14
|
+
'&:hover': {
|
|
15
|
+
opacity: '.75',
|
|
11
16
|
},
|
|
12
17
|
},
|
|
13
18
|
},
|
|
@@ -15,14 +20,14 @@ module.exports = {
|
|
|
15
20
|
};
|
|
16
21
|
},
|
|
17
22
|
twFirstLetterPlugin: function ({ addVariant, e }) {
|
|
18
|
-
addVariant(
|
|
23
|
+
addVariant('first-letter', ({ modifySelectors, separator }) => {
|
|
19
24
|
modifySelectors(({ className }) => {
|
|
20
25
|
return `.${e(`first-letter${separator}${className}`)}:first-letter`;
|
|
21
26
|
});
|
|
22
27
|
});
|
|
23
28
|
},
|
|
24
29
|
twFirstChildPlugin: function ({ addVariant, e }) {
|
|
25
|
-
addVariant(
|
|
30
|
+
addVariant('first-child', ({ modifySelectors, separator }) => {
|
|
26
31
|
modifySelectors(({ className }) => {
|
|
27
32
|
return `.${e(`first-child${separator}${className}`)}:first-child`;
|
|
28
33
|
});
|
|
@@ -30,18 +35,18 @@ module.exports = {
|
|
|
30
35
|
},
|
|
31
36
|
twBleedPlugin: function ({ addUtilities }) {
|
|
32
37
|
addUtilities({
|
|
33
|
-
|
|
34
|
-
width:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
transform:
|
|
38
|
-
|
|
38
|
+
'.bleed': {
|
|
39
|
+
width: '100vw',
|
|
40
|
+
'margin-inline-start': '50%',
|
|
41
|
+
'margin-inline-end': 'unset',
|
|
42
|
+
transform: 'translateX(-50%)',
|
|
43
|
+
'max-width': 'none',
|
|
39
44
|
},
|
|
40
|
-
|
|
41
|
-
width:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
transform:
|
|
45
|
+
'.bleed-disable': {
|
|
46
|
+
width: 'inherit',
|
|
47
|
+
'margin-inline-start': 'inherit',
|
|
48
|
+
'margin-inline-end': 'inherit',
|
|
49
|
+
transform: 'default',
|
|
45
50
|
},
|
|
46
51
|
});
|
|
47
52
|
},
|