@olenbetong/appframe-vite 2.2.3 → 2.2.5

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.
Files changed (2) hide show
  1. package/lib/devServer.js +40 -11
  2. package/package.json +2 -2
package/lib/devServer.js CHANGED
@@ -19,7 +19,7 @@ async function getUserSession() {
19
19
  let client = new Client(hostname);
20
20
  await client.login(username, password);
21
21
  let userResult = await client.afFetch("/api/system/usersession", {
22
- timeout: 5000
22
+ timeout: 5000,
23
23
  });
24
24
  userSession = await userResult.json();
25
25
  return userSession;
@@ -48,13 +48,13 @@ export function createProxyMiddleware() {
48
48
  "/exec/*",
49
49
  "/report/*",
50
50
  "/rowcount/*",
51
- "/lib/*"
51
+ "/lib/*",
52
52
  ];
53
53
  if (appframe.proxy?.routes) {
54
54
  proxyRoutes.push(...appframe.proxy.routes);
55
55
  }
56
56
  const router = express.Router();
57
- proxyRoutes.forEach(route => {
57
+ proxyRoutes.forEach((route) => {
58
58
  router.use(route, proxy);
59
59
  });
60
60
  return router;
@@ -64,14 +64,43 @@ export function createHtmlTransformer() {
64
64
  let isPartner = appPkg.appframe?.article?.hostname === "partner.olenbetong.no";
65
65
  let userSession = await getUserSession();
66
66
  return html
67
- .replace("<!-- {Appframe} -->", ` <script src="/lib/@olenbetong/appframe-core/2.0.2/dist/iife/af.common.js"></script>
68
- <script src="/lib/@olenbetong/appframe-data/0.2.3/dist/iife/af.data.js"></script>
69
-
70
- <script>
71
- af = globalThis.af ?? {};
72
- af.userSession = ${JSON.stringify(userSession)};
73
- </script>
74
- <script src="/file/article/static-script/${appframe.article.id}.js"></script>`)
67
+ .replace("<!-- {Appframe} -->", `<script src="/lib/@olenbetong/appframe-core/2.0.2/dist/iife/af.common.js"></script>
68
+ <script src="/lib/@olenbetong/appframe-data/0.2.3/dist/iife/af.data.js"></script>
69
+ <script>
70
+ af = globalThis.af ?? {};
71
+ af.userSession = ${JSON.stringify(userSession)};
72
+ </script>
73
+ <script src="/file/article/static-script/${appframe.article.id}.js"></script>
74
+ <script>
75
+ var SkipToConfig = {
76
+ 'settings': {
77
+ 'skipTo': {
78
+ landmarks: 'main, [role="main"], [role="search"], nav, [role="navigation"], aside, [role="complementary"], section',
79
+ headings: 'main h1, main h2, main h3',
80
+ colorTheme: 'default',
81
+ displayOption: "popup",
82
+ positionLeft: "0",
83
+ buttonLabel: af?.common?.getLocalizedString("Skip to Content") ?? "Hopp til innhold",
84
+ buttonTooltipAccesskey: af?.common?.getLocalizedString('Accesskey is "$key"') ?? "Tastatursnarvei er '$key'",
85
+ menuLabel: af?.common?.getLocalizedString('Landmarks and Headings') ?? "Landemerker og overskrifter",
86
+ landmarkGroupLabel: af?.common?.getLocalizedString('Landmarks') ?? "Landemerker",
87
+ headingGroupLabel: af?.common?.getLocalizedString('Headings') ?? "Overskrifter",
88
+ mofnGroupLabel: af?.common?.getLocalizedString('$m of $n') ?? "$m av $n",
89
+ headingLevelLabel: af?.common?.getLocalizedString('Heading level') ?? "Overskriftsnivå",
90
+ mainLabel: af?.common?.getLocalizedString('main') ?? "main",
91
+ searchLabel: af?.common?.getLocalizedString('search') ?? "søk",
92
+ navLabel: af?.common?.getLocalizedString('navigation') ?? "navigasjon",
93
+ asideLabel: af?.common?.getLocalizedString('aside') ?? "aside",
94
+ footerLabel: af?.common?.getLocalizedString('footer') ?? "footer",
95
+ headerLabel: af?.common?.getLocalizedString('header') ?? "header",
96
+ formLabel: af?.common?.getLocalizedString('form') ?? "skjema",
97
+ msgNoLandmarksFound: af?.common?.getLocalizedString('No landmarks to skip to') ?? "Ingen landemerker å hoppe til",
98
+ msgNoHeadingsFound: af?.common?.getLocalizedString('No main headings to skip to') ?? "Ingen overskrifter å hoppe til"
99
+ }
100
+ }
101
+ };
102
+ </script>
103
+ <script src="/lib/paypal-skipto/downloads/js/skipto.min.js" async></script>`)
75
104
  .replace(`<!-- {Theme} -->`, isPartner
76
105
  ? ` <link rel="stylesheet" href="/file/site/style/ob.application.min.css" />
77
106
  <link rel="stylesheet" href="/file/site/style/ob.theme.base.less" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olenbetong/appframe-vite",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Tools to use and deploy Vite applications to Appframe",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -39,5 +39,5 @@
39
39
  "open": "^8.4.0",
40
40
  "tcp-port-used": "^1.0.2"
41
41
  },
42
- "gitHead": "f48a29effee563b9b0976d4b0aca92573fcd9491"
42
+ "gitHead": "4b1a647f568dfed70e408aced03cf9094137f05b"
43
43
  }