@dosgato/templating 0.0.57 → 0.0.58
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/dist/provider.d.ts +34 -0
- package/dist/provider.js +13 -0
- package/package.json +1 -1
package/dist/provider.d.ts
CHANGED
|
@@ -75,6 +75,27 @@ export interface FileDeclaration {
|
|
|
75
75
|
*/
|
|
76
76
|
mime?: string;
|
|
77
77
|
}
|
|
78
|
+
export interface SCSSInclude {
|
|
79
|
+
/**
|
|
80
|
+
* The SASS code as a string. This SCSS should generally only include functions
|
|
81
|
+
* and mixins. Regular CSS should be included as its own block so it can be de-duplicated.
|
|
82
|
+
*
|
|
83
|
+
* Variables don't make much sense because we only have one version of a block every
|
|
84
|
+
* time it's used, whereas variables usually change from page template to page template.
|
|
85
|
+
* Use CSS variables instead.
|
|
86
|
+
*/
|
|
87
|
+
scss?: string;
|
|
88
|
+
/**
|
|
89
|
+
* A file path to the SASS code.
|
|
90
|
+
*/
|
|
91
|
+
path?: string;
|
|
92
|
+
/**
|
|
93
|
+
* A version string following SEMVER. If multiple blocks are provided with the same name,
|
|
94
|
+
* the one with the highest version number will be chosen. If blocks of different major
|
|
95
|
+
* versions are provided, an alert will appear in the log.
|
|
96
|
+
*/
|
|
97
|
+
version?: string;
|
|
98
|
+
}
|
|
78
99
|
/**
|
|
79
100
|
* This class is a parent class for Component, but it can also be used as a standalone
|
|
80
101
|
* if you are creating a set of templates with shared resources. This will be fairly
|
|
@@ -106,6 +127,19 @@ export declare abstract class ResourceProvider {
|
|
|
106
127
|
* and the user has clicked something.
|
|
107
128
|
*/
|
|
108
129
|
static cssBlocks: Map<string, CSSBlock>;
|
|
130
|
+
/**
|
|
131
|
+
* A template can provide SASS mixins and functions for use by other SASS-based CSS
|
|
132
|
+
* blocks.
|
|
133
|
+
*
|
|
134
|
+
* These includes can be utilized by other SASS with the SASS `@use` and `@include`
|
|
135
|
+
* commands, e.g.
|
|
136
|
+
* ```
|
|
137
|
+
* @use 'my-mixin-name' as mx;
|
|
138
|
+
* .someclass { @include mx.somemixin(); }
|
|
139
|
+
* ```
|
|
140
|
+
* In this case `my-mixin-name` is the key used for this Map.
|
|
141
|
+
*/
|
|
142
|
+
static scssIncludes: Map<string, SCSSInclude>;
|
|
109
143
|
/**
|
|
110
144
|
* Same as cssBlocks() but for javascript.
|
|
111
145
|
*
|
package/dist/provider.js
CHANGED
|
@@ -32,6 +32,19 @@ export class ResourceProvider {
|
|
|
32
32
|
* and the user has clicked something.
|
|
33
33
|
*/
|
|
34
34
|
ResourceProvider.cssBlocks = new Map();
|
|
35
|
+
/**
|
|
36
|
+
* A template can provide SASS mixins and functions for use by other SASS-based CSS
|
|
37
|
+
* blocks.
|
|
38
|
+
*
|
|
39
|
+
* These includes can be utilized by other SASS with the SASS `@use` and `@include`
|
|
40
|
+
* commands, e.g.
|
|
41
|
+
* ```
|
|
42
|
+
* @use 'my-mixin-name' as mx;
|
|
43
|
+
* .someclass { @include mx.somemixin(); }
|
|
44
|
+
* ```
|
|
45
|
+
* In this case `my-mixin-name` is the key used for this Map.
|
|
46
|
+
*/
|
|
47
|
+
ResourceProvider.scssIncludes = new Map();
|
|
35
48
|
/**
|
|
36
49
|
* Same as cssBlocks() but for javascript.
|
|
37
50
|
*
|