Skip to content

Commit 548394b

Browse files
authored
Merge pull request #827 from Patternslib/scr-984
[WIP] Prepare release
2 parents e2fb089 + ab1af51 commit 548394b

File tree

55 files changed

+2157
-2133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2157
-2133
lines changed

CHANGES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,27 @@
2626
- pat date picker: Remove ``format`` argument and just use the ISO 8601 standard "YYYY-MM-DD", like the specification of date inputs defines it.
2727
Format would have submitted a formatted value where the ISO standard is expected.
2828
This also allows for removing the dependency of ``pat-date-picker`` on MomentJS.
29+
- pat datetime picker:
30+
- Change CSS selectors for better namespacing and remove implicit dependency on glyphicons.
31+
- Remove dependency on MomentJS.
32+
- After updating the original input, let the ``change`` event bubble up.
33+
- Support ``native`` behavior.
34+
2935

3036
### Features
3137

38+
- pat gallery: Import styles for photoswipe.
39+
- pat carousel: Import styles for slick carousel.
40+
- pat auto suggest: Import styles for select2.
41+
- pat-tooltip: Import styles for tippy.
42+
- pat-modal: Import styles.
43+
- pat datetime picker: Import styles.
44+
- pat date picker: Import styles for pikaday.
45+
- Styles: Import styles by setting ``__patternslib_import_styles``
46+
Allow importing styles from external libraries in Patternslib JavaScript via the global variable ``window.__patternslib_import_styles`` set to ``true``.
47+
This allows loading these styles automatically via Webpack.
48+
Disable setting style import per default.
49+
- pat carousel: Use ``imagesloaded`` instead of timeout to wait for images to have been loaded.
3250
- core registry: Do not scan patterns within trees with attribute ``hidden`` or class ``cant-touch-this``.
3351
- Implenent lazy loading for external libraries via dynamic imports. Leads to significantly reduced bundle sizes.
3452
- Upgrade pat-calendar to use latest fullcalendar version (5.3.0).
@@ -72,8 +90,13 @@
7290
- pat-scroll: Implement `selector:bottom` attribute value to scroll to the bottom of the scroll container.
7391
- pat-scroll: Do handle click events also when trigger is set to `auto`.
7492

93+
7594
### Technical
7695

96+
- Infrastructure: Upgrade jQuery to 3.6.0.
97+
- Webpack: Backport changes from Mockup - add loaders for images, svg, sass and xml.
98+
- Webpack: Automatically detect the chunk path or "__webpack_public_path__" while still allowing for overriding via "__patternslib_public_path__".
99+
- Export all parsers in all patterns to be able to modify default values or add aliases.
77100
- core polyfills: Add polyfill for Node.closest method.
78101
- Core Base: ``await`` for initalization in the base class constructor, so that the ``init`` event is really thrown after initialization is done.
79102
- pat calendar: Explicitly import JavaScript language files to avoid missing Webpack TypeScript loader errors.
@@ -104,6 +127,7 @@
104127
- core base: Add the parser instance to pattern attributes if available.
105128
We can then reuse the parser from registered patterns. This is used in the ``_rebaseHTML`` method of pat-inject to URL-rebase the pattern configuration.
106129

130+
107131
### Fixes
108132

109133
- core dom is_visible: Mock in tests to check only for hidden to avoid unavailable offsetWidth/offsetHeight in Jest.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"google-code-prettify": "^1.0.5",
2828
"imagesloaded": "^4.1.4",
2929
"intersection-observer": "^0.7.0",
30-
"jquery": "^3.5.1",
30+
"jquery": "^3.6.0",
3131
"jquery-jcrop": "^0.9.13",
3232
"luxon": "^1.24.1",
3333
"masonry-layout": "^4.2.2",
@@ -64,15 +64,18 @@
6464
"eslint": "^7.0.0",
6565
"eslint-config-prettier": "^6.11.0",
6666
"expose-loader": "^0.7.5",
67+
"file-loader": "^6.2.0",
6768
"identity-obj-proxy": "^3.0.0",
6869
"imports-loader": "^0.8.0",
6970
"jest": "^26.0.1",
7071
"jest-watch-typeahead": "^0.6.0",
7172
"prettier": "^2.1.2",
7273
"raw-loader": "^4.0.1",
7374
"regenerator-runtime": "^0.13.5",
74-
"sass": "^1.26.5",
75+
"sass": "^1.32.8",
76+
"sass-loader": "^10.1.1",
7577
"style-loader": "^1.2.1",
78+
"svg-inline-loader": "^0.8.2",
7679
"terser-webpack-plugin": "^2.3.6",
7780
"webpack": "^4.43.0",
7881
"webpack-bundle-analyzer": "^3.8.0",
@@ -84,7 +87,7 @@
8487
},
8588
"resolutions": {
8689
"clean-css": "4.2.3",
87-
"jquery": "3.5.1",
90+
"jquery": "3.6.0",
8891
"lodash": "4.17.20",
8992
"moment": "2.29.0",
9093
"serialize-javascript": "4.0.0",

src/core/push_kit.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
import "regenerator-runtime/runtime"; // needed for ``await`` support
3232
import $ from "jquery";
3333

34-
// Lazy loading modules.
35-
let StompJS;
36-
3734
const push_kit = {
3835
async init() {
3936
const push_url = $("meta[name=patterns-push-server-url]").attr("content"); // prettier-ignore
@@ -47,7 +44,7 @@ const push_kit = {
4744
const push_login = $("meta[name=patterns-push-login]").attr("content"); // prettier-ignore
4845
const push_pass = $("meta[name=patterns-push-password]").attr("content"); // prettier-ignore
4946

50-
StompJS = await import("@stomp/stompjs");
47+
const StompJS = await import("@stomp/stompjs");
5148
const client = new StompJS.Client({
5249
brokerURL: push_url,
5350
connectHeaders: {

src/pat/ajax/ajax.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import logging from "../../core/logging";
99
import Parser from "../../core/parser";
1010
import registry from "../../core/registry";
1111

12-
var log = logging.getLogger("pat.ajax"),
13-
parser = new Parser("ajax");
12+
const log = logging.getLogger("pat.ajax");
13+
14+
export const parser = new Parser("ajax");
1415
parser.addArgument("url", function ($el) {
1516
return ($el.is("a")
1617
? $el.attr("href")

src/pat/auto-scale/auto-scale.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Parser from "../../core/parser";
1111
import _ from "underscore";
1212
import utils from "../../core/utils";
1313

14-
const parser = new Parser("auto-scale");
14+
export const parser = new Parser("auto-scale");
1515
parser.addArgument("method", "scale", ["scale", "zoom"]);
1616
parser.addArgument("size", "width", ["width", "height", "contain", "cover"]);
1717
parser.addArgument("min-width", 0);

src/pat/auto-submit/auto-submit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import utils from "../../core/utils";
88

99
const log = logging.getLogger("autosubmit");
1010

11-
const parser = new Parser("autosubmit");
11+
export const parser = new Parser("autosubmit");
1212
// - 400ms -> 400
1313
// - 400 -> 400
1414
// - defocus

src/pat/auto-suggest/_auto-suggest.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
/* @group Auto suggest */
55

6-
.lt-ie9 .pat-autosuggest {
7-
min-width: 175px;
8-
/* Trying to resolve the 1px wide issue in IE8 */
9-
}
10-
116
/*
127
Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
138
*/
@@ -23,11 +18,6 @@ Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
2318
width: 100%;
2419
}
2520

26-
.lt-ie10 .select2-container {
27-
width: 100% !important;
28-
height: auto !important;
29-
}
30-
3121
.select2-container,
3222
.select2-drop {
3323
box-sizing: border-box;

src/pat/auto-suggest/auto-suggest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Parser from "../../core/parser";
77

88
const log = logging.getLogger("autosuggest");
99

10-
const parser = new Parser("autosuggest");
10+
export const parser = new Parser("autosuggest");
1111
parser.addArgument("ajax-data-type", "JSON");
1212
parser.addArgument("ajax-search-index", "");
1313
parser.addArgument("ajax-url", "");
@@ -41,6 +41,9 @@ export default Base.extend({
4141
trigger: ".pat-autosuggest,.pat-auto-suggest",
4242

4343
async init() {
44+
if (window.__patternslib_import_styles) {
45+
import("select2/select2.css");
46+
}
4447
await import("select2");
4548

4649
this.options = parser.parse(this.el, this.options);

src/pat/bumper/bumper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Base from "../../core/base";
1313
import Parser from "../../core/parser";
1414
import utils from "../../core/utils";
1515

16-
const parser = new Parser("bumper");
16+
export const parser = new Parser("bumper");
1717
parser.addArgument("margin", 0);
1818
parser.addArgument("selector");
1919
parser.addArgument("bump-add", "bumped");

src/pat/calendar/calendar.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import registry from "../../core/registry";
77
import store from "../../core/store";
88

99
const log = logging.getLogger("calendar");
10-
const parser = new Parser("calendar");
10+
export const parser = new Parser("calendar");
1111

1212
parser.addArgument("calendar-controls", ""); // Calendar controls must have "id" attr set
1313
parser.addArgument("category-controls", "");
@@ -101,18 +101,12 @@ export default Base.extend({
101101
async init($el, opts) {
102102
const el = this.el;
103103

104-
let Calendar = await import("@fullcalendar/core");
105-
Calendar = Calendar.Calendar;
106-
let fcDayGrid = await import("@fullcalendar/daygrid");
107-
let fcInteraction = await import("@fullcalendar/interaction");
108-
let fcList = await import("@fullcalendar/list");
109-
let fcLuxon = await import("@fullcalendar/luxon");
110-
let fcTimeGrid = await import("@fullcalendar/timegrid");
111-
fcDayGrid = fcDayGrid.default;
112-
fcInteraction = fcInteraction.default;
113-
fcList = fcList.default;
114-
fcLuxon = fcLuxon.default;
115-
fcTimeGrid = fcTimeGrid.default;
104+
const Calendar = (await import("@fullcalendar/core")).Calendar;
105+
const fcDayGrid = (await import("@fullcalendar/daygrid")).default;
106+
const fcInteraction = (await import("@fullcalendar/interaction")).default; // prettier-ignore
107+
const fcList = (await import("@fullcalendar/list")).default;
108+
const fcLuxon = (await import("@fullcalendar/luxon")).default;
109+
const fcTimeGrid = (await import("@fullcalendar/timegrid")).default;
116110

117111
// Save some UI elements for reuse.
118112
this.el_jump_next = el.querySelector(".jump-next");

0 commit comments

Comments
 (0)