@pushword/js-helper 0.0.59 → 0.0.60

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushword/js-helper",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "description": "Pushword front end helpers. ",
5
5
  "author": "Robin@PiedWeb <contact@piedweb.com>",
6
6
  "license": "MIT",
package/src/app.css ADDED
@@ -0,0 +1,4 @@
1
+ @import "tailwindcss/base";
2
+ @import "tailwindcss/components";
3
+ @import "tailwindcss/utilities";
4
+ @import "@pushword/js-helper/src/tailwind.prose.scss";
package/src/app.js ADDED
@@ -0,0 +1,27 @@
1
+ require("fslightbox");
2
+ import {
3
+ uncloakLinks,
4
+ readableEmail,
5
+ convertImageLinkToWebPLink,
6
+ replaceOn,
7
+ liveBlock,
8
+ } from "@pushword/js-helper/src/helpers.js";
9
+ import { allClickable } from "@pushword/js-helper/src/clickable.js";
10
+
11
+ function onDomChanged() {
12
+ liveBlock();
13
+ convertImageLinkToWebPLink();
14
+ uncloakLinks();
15
+ readableEmail(".cea");
16
+ replaceOn();
17
+ refreshFsLightbox();
18
+ allClickable(".clickable");
19
+ }
20
+
21
+ function onPageLoaded() {
22
+ onDomChanged();
23
+ new FsLightbox();
24
+ }
25
+
26
+ document.addEventListener("DOMContentLoaded", onPageLoaded());
27
+ document.addEventListener("DOMChanged", onDomChanged);
package/src/encore.js CHANGED
@@ -30,23 +30,13 @@ module.exports = {
30
30
  publicPath = "/assets",
31
31
  manifestKeyPrefix = null,
32
32
  filesToCopy = [
33
- {
34
- from: "./media/", // todo explain
35
- to: "[name].[ext]",
36
- pattern: /svg$/,
37
- },
38
- {
39
- from: "./img/",
40
- to: "[name].[ext]",
41
- pattern: /header.jpg$/,
42
- },
43
33
  {
44
34
  from: "./favicons",
45
35
  to: "[name].[ext]",
46
36
  },
47
37
  ],
48
- entries = [{ name: "app", file: "./app.js" }],
49
- styleEntries = [{ name: "style", file: "./app.css" }]
38
+ entries = null,
39
+ styleEntries = null
50
40
  ) {
51
41
  if (watchFiles === null) {
52
42
  watchFiles = getFilesToWatch();
@@ -56,6 +46,18 @@ module.exports = {
56
46
  tailwindConfig = getTailwindConfig(watchFiles);
57
47
  }
58
48
 
49
+ if (entries === null) {
50
+ entries = [{ name: "app", file: __dirname + "/app.js" }];
51
+ } else if (typeof entries === "string") {
52
+ entries = [{ name: "app", file: entries }];
53
+ }
54
+
55
+ if (styleEntries === null) {
56
+ styleEntries = [{ name: "style", file: __dirname + "/app.css" }];
57
+ } else if (typeof styleEntries === "string") {
58
+ styleEntries = [{ name: "style", file: styleEntries }];
59
+ }
60
+
59
61
  Encore.setOutputPath(outputPath)
60
62
  .setPublicPath(publicPath)
61
63
  .cleanupOutputBeforeBuild()