@newlogic-digital/core 1.0.4 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +15 -3
- package/latte/CodeFilter.php +16 -0
- package/package.json +3 -2
package/index.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import tailwind from '@vituum/tailwind'
|
2
1
|
import posthtml from '@vituum/posthtml'
|
3
2
|
import juice from '@vituum/juice'
|
4
3
|
import twig from '@vituum/twig'
|
@@ -9,6 +8,13 @@ import fs from 'fs'
|
|
9
8
|
import { dirname, resolve } from 'path'
|
10
9
|
import postHtml from 'posthtml'
|
11
10
|
import highlight from './prism.js'
|
11
|
+
import tailwindcss from 'tailwindcss'
|
12
|
+
import tailwindcssNesting from 'tailwindcss/nesting/index.js'
|
13
|
+
import postcssImport from 'postcss-import'
|
14
|
+
import postcssNesting from 'postcss-nesting'
|
15
|
+
import postcssCustomMedia from 'postcss-custom-media'
|
16
|
+
import postcssCustomSelectors from 'postcss-custom-selectors'
|
17
|
+
import autoprefixer from 'autoprefixer'
|
12
18
|
|
13
19
|
const posthtmlPrism = {
|
14
20
|
name: '@vituum/vite-plugin-posthtml-prism',
|
@@ -19,7 +25,6 @@ const posthtmlPrism = {
|
|
19
25
|
filename = filename.replace('?raw', '')
|
20
26
|
|
21
27
|
if (!filename.endsWith('ui.json')) {
|
22
|
-
console.log(filename)
|
23
28
|
return
|
24
29
|
}
|
25
30
|
|
@@ -251,7 +256,7 @@ const integration = (userConfig = {}) => {
|
|
251
256
|
|
252
257
|
return {
|
253
258
|
config: {
|
254
|
-
integrations: [posthtml(userConfig.posthtml), juice(userConfig.juice),
|
259
|
+
integrations: [posthtml(userConfig.posthtml), juice(userConfig.juice), twig(userConfig.twig), latte(userConfig.latte)],
|
255
260
|
plugins: [posthtmlPrism],
|
256
261
|
server: {
|
257
262
|
open: true,
|
@@ -267,6 +272,13 @@ const integration = (userConfig = {}) => {
|
|
267
272
|
vite: {
|
268
273
|
server: {
|
269
274
|
origin: fs.existsSync(resolve(process.cwd(), 'app/settings.php')) ? (fs.readFileSync(resolve(process.cwd(), 'app/settings.php')).toString().match(/VITE_URL = '(.+)';/) || [null, null])[1] : null
|
275
|
+
},
|
276
|
+
css: {
|
277
|
+
postcss: {
|
278
|
+
plugins: [postcssImport, tailwindcssNesting(postcssNesting({
|
279
|
+
noIsPseudoSelector: true
|
280
|
+
})), postcssCustomMedia, postcssCustomSelectors, tailwindcss(userConfig.tailwind), autoprefixer]
|
281
|
+
}
|
270
282
|
}
|
271
283
|
}
|
272
284
|
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
namespace App\Latte;
|
4
|
+
|
5
|
+
class CodeFilter
|
6
|
+
{
|
7
|
+
|
8
|
+
public static function execute($value, $type = null, $mirror = null): \Latte\Runtime\Html
|
9
|
+
{
|
10
|
+
if ($mirror) {
|
11
|
+
$mirror = $value;
|
12
|
+
}
|
13
|
+
|
14
|
+
return new \Latte\Runtime\Html("$mirror<pre><code class='language-{$type}'>$value</code></pre>");
|
15
|
+
}
|
16
|
+
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@newlogic-digital/core",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.7",
|
5
5
|
"main": "index.js",
|
6
6
|
"author": "New Logic Studio s.r.o.",
|
7
7
|
"description": "Set of tools that can be used to create modern web applications",
|
@@ -19,9 +19,10 @@
|
|
19
19
|
"prismjs": "^1.29.0",
|
20
20
|
"html-minifier-terser": "^7.0.0",
|
21
21
|
"lodash": "^4.17.21",
|
22
|
-
"vituum": "^0.0.
|
22
|
+
"vituum": "^0.0.29"
|
23
23
|
},
|
24
24
|
"files": [
|
25
|
+
"latte",
|
25
26
|
"index.js",
|
26
27
|
"prism.js"
|
27
28
|
],
|