@olenbetong/appframe-vite 2.2.4 → 2.2.6

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 +29 -28
  2. package/package.json +3 -3
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,7 +64,15 @@ 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>
67
+ .replace("<!-- {Appframe} -->", `<script src="/lib/@olenbetong/appframe-core/2.0.4/dist/iife/af.common.js"></script>
68
+ <script src="/lib/@olenbetong/appframe-data/0.3.0/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 l = window.af?.common?.getLocalizedString ?? (s) => s;
68
76
  var SkipToConfig = {
69
77
  'settings': {
70
78
  'skipTo': {
@@ -73,34 +81,27 @@ var SkipToConfig = {
73
81
  colorTheme: 'default',
74
82
  displayOption: "popup",
75
83
  positionLeft: "0",
76
- buttonLabel: af?.common?.getLocalizedString("Skip to Content") ?? "Hopp til innhold",
77
- buttonTooltipAccesskey: af?.common?.getLocalizedString('Accesskey is "$key"') ?? "Tastatursnarvei er '$key'",
78
- menuLabel: af?.common?.getLocalizedString('Landmarks and Headings') ?? "Landemerker og overskrifter",
79
- landmarkGroupLabel: af?.common?.getLocalizedString('Landmarks') ?? "Landemerker",
80
- headingGroupLabel: af?.common?.getLocalizedString('Headings') ?? "Overskrifter",
81
- mofnGroupLabel: af?.common?.getLocalizedString('$m of $n') ?? "$m av $n",
82
- headingLevelLabel: af?.common?.getLocalizedString('Heading level') ?? "Overskriftsnivå",
83
- mainLabel: af?.common?.getLocalizedString('main') ?? "main",
84
- searchLabel: af?.common?.getLocalizedString('search') ?? "søk",
85
- navLabel: af?.common?.getLocalizedString('navigation') ?? "navigasjon",
86
- asideLabel: af?.common?.getLocalizedString('aside') ?? "aside",
87
- footerLabel: af?.common?.getLocalizedString('footer') ?? "footer",
88
- headerLabel: af?.common?.getLocalizedString('header') ?? "header",
89
- formLabel: af?.common?.getLocalizedString('form') ?? "skjema",
90
- msgNoLandmarksFound: af?.common?.getLocalizedString('No landmarks to skip to') ?? "Ingen landemerker å hoppe til",
91
- msgNoHeadingsFound: af?.common?.getLocalizedString('No main headings to skip to') ?? "Ingen overskrifter å hoppe til"
84
+ buttonLabel: l("Skip to Content") ?? "Hopp til innhold",
85
+ buttonTooltipAccesskey: l('Accesskey is "$key"') ?? "Tastatursnarvei er '$key'",
86
+ menuLabel: l('Landmarks and Headings') ?? "Landemerker og overskrifter",
87
+ landmarkGroupLabel: l('Landmarks') ?? "Landemerker",
88
+ headingGroupLabel: l('Headings') ?? "Overskrifter",
89
+ mofnGroupLabel: l('$m of $n') ?? "$m av $n",
90
+ headingLevelLabel: l('Heading level') ?? "Overskriftsnivå",
91
+ mainLabel: l('main') ?? "main",
92
+ searchLabel: l('search') ?? "søk",
93
+ navLabel: l('navigation') ?? "navigasjon",
94
+ asideLabel: l('aside') ?? "aside",
95
+ footerLabel: l('footer') ?? "footer",
96
+ headerLabel: l('header') ?? "header",
97
+ formLabel: l('form') ?? "skjema",
98
+ msgNoLandmarksFound: l('No landmarks to skip to') ?? "Ingen landemerker å hoppe til",
99
+ msgNoHeadingsFound: l('No main headings to skip to') ?? "Ingen overskrifter å hoppe til"
92
100
  }
93
101
  }
94
102
  };
95
103
  </script>
96
- <script src="/lib/paypal-skipto/downloads/js/skipto.min.js" async></script>
97
- <script src="/lib/@olenbetong/appframe-core/2.0.2/dist/iife/af.common.js"></script>
98
- <script src="/lib/@olenbetong/appframe-data/0.2.3/dist/iife/af.data.js"></script>
99
- <script>
100
- af = globalThis.af ?? {};
101
- af.userSession = ${JSON.stringify(userSession)};
102
- </script>
103
- <script src="/file/article/static-script/${appframe.article.id}.js"></script>`)
104
+ <script src="/lib/paypal-skipto/downloads/js/skipto.min.js" async></script>`)
104
105
  .replace(`<!-- {Theme} -->`, isPartner
105
106
  ? ` <link rel="stylesheet" href="/file/site/style/ob.application.min.css" />
106
107
  <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.4",
3
+ "version": "2.2.6",
4
4
  "description": "Tools to use and deploy Vite applications to Appframe",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "author": "Bjørnar Vister Hansen <bvh@olenbetong.no>",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@olenbetong/appframe-data": "^0.2.3",
22
+ "@olenbetong/appframe-data": "^0.3.0",
23
23
  "dotenv": "^16.0.1",
24
24
  "rollup-plugin-visualizer": "^5.8.0",
25
25
  "vite-plugin-externals": "^0.5.0"
@@ -39,5 +39,5 @@
39
39
  "open": "^8.4.0",
40
40
  "tcp-port-used": "^1.0.2"
41
41
  },
42
- "gitHead": "e8336d87d843ac989b1d63e5910e3b8e27e3ba52"
42
+ "gitHead": "54a3113954ea43225436b2179f2343bb0ae37b96"
43
43
  }