codeplay-common 4.2.3 → 4.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.
- package/.gitattributes +2 -2
- package/LICENSE +21 -21
- package/README.md +119 -103
- package/agent-templates/manifest.json +7 -0
- package/agent-templates/v1.0/AGENTS/agent-screenshot.md +12 -0
- package/agent-templates/v1.0/AGENTS/agent-temp.md +4 -0
- package/agent-templates/v1.0/AGENTS/agents-create-new-page.md +242 -0
- package/agent-templates/v1.0/AGENTS/agents.md +364 -0
- package/agent-templates/v1.0/AGENTS/common-changes.md +0 -0
- package/agent-templates/v1.0/AGENTS/playstore-media.md +17 -0
- package/agent-templates/v1.0/AGENTS/versioning.md +14 -0
- package/agent-templates/v1.0/AGENTS.md +6 -0
- package/files/buildCodeplay/codeplayBeforeBuild-6.2.js +4040 -4040
- package/files/buildCodeplay/versions.json +23 -23
- package/files/finalrelease +951 -951
- package/files/iap-install-2.js +145 -145
- package/files/ionic.config.json +6 -6
- package/files/scripts/setup-baseline-profile.js +257 -257
- package/package.json +15 -15
- package/scripts/sync-files.js +155 -105
- package/scripts/uninstall.js +109 -104
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Merbin Joe
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Merbin Joe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,103 +1,119 @@
|
|
|
1
|
-
# codeplay-common
|
|
2
|
-
Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Easy add splashscreen and set animation
|
|
6
|
-
Admob id automatically from capacitor.config.json file
|
|
7
|
-
Make three build file for different store as per our requirement
|
|
8
|
-
Based on store install various IAP plugins
|
|
9
|
-
Make it to ionic project
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Version 4.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Version 4.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Version 4.1.
|
|
48
|
-
"consentDebug
|
|
49
|
-
|
|
50
|
-
Version 4.1.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Version 4.1.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Version 4.0.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
# codeplay-common
|
|
2
|
+
Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Easy add splashscreen and set animation
|
|
6
|
+
Admob id automatically from capacitor.config.json file
|
|
7
|
+
Make three build file for different store as per our requirement
|
|
8
|
+
Based on store install various IAP plugins
|
|
9
|
+
Make it to ionic project
|
|
10
|
+
|
|
11
|
+
## Agent instruction templates
|
|
12
|
+
|
|
13
|
+
Agent instructions are maintained independently under `agent-templates/v<version>/`.
|
|
14
|
+
The version in `agent-templates/manifest.json` is installed by default. To pin a
|
|
15
|
+
project to a specific instruction version, add this to the project's `package.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"codeplayCommon": {
|
|
19
|
+
"agentsVersion": "1.0"
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
During npm installation, the selected template's `AGENTS.md` and `AGENTS/` folder
|
|
24
|
+
are copied to the project root. Project-only files with different names inside
|
|
25
|
+
`AGENTS/` are preserved.
|
|
26
|
+
|
|
27
|
+
Donate to get full code including many common functions
|
|
28
|
+
https://ko-fi.com/codeplay
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Version 4.2.3
|
|
32
|
+
Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
|
|
33
|
+
|
|
34
|
+
Version 4.2.2
|
|
35
|
+
Added "bannerDisabledPages" property and its default value
|
|
36
|
+
The admob configuration default value priority is updated
|
|
37
|
+
|
|
38
|
+
Version 4.2.1
|
|
39
|
+
Updated AdMob nextgen file validation to match admob-emi-nextgen file names.
|
|
40
|
+
|
|
41
|
+
Version 4.2.0
|
|
42
|
+
Firebase related automatic changes updated
|
|
43
|
+
|
|
44
|
+
Version 4.1.9
|
|
45
|
+
Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
|
|
46
|
+
|
|
47
|
+
Version 4.1.8
|
|
48
|
+
"consentDebug: false" is added
|
|
49
|
+
|
|
50
|
+
Version 4.1.7
|
|
51
|
+
admob configuration automatically added.
|
|
52
|
+
|
|
53
|
+
Version 4.1.6
|
|
54
|
+
"setup-baseline-profile.js" modification, duplicate validation error fixed
|
|
55
|
+
|
|
56
|
+
Version 4.1.5
|
|
57
|
+
While isTesting is true it is not validated from our new configuration admob file, now it is solved
|
|
58
|
+
|
|
59
|
+
Version 4.1.4
|
|
60
|
+
hardcoded version is removed for the admob-emi-nextgen
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
Version 4.1.3
|
|
64
|
+
"consentDebug": false automatically adds if not
|
|
65
|
+
|
|
66
|
+
Version 4.1.2
|
|
67
|
+
Speedup
|
|
68
|
+
|
|
69
|
+
Version 4.1.1
|
|
70
|
+
Auto admob integration updated
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
version 4.0.9
|
|
74
|
+
packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
version 4.0.8
|
|
78
|
+
safearea plugin is checked and removed automatically
|
|
79
|
+
Automatically added following in capacitor.config.json file
|
|
80
|
+
"SystemBars": {
|
|
81
|
+
"insetsHandling": "css"
|
|
82
|
+
}
|
|
83
|
+
patchFile() method is removed
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
Version 4.0.6
|
|
89
|
+
IAP related some automatic variable creation and validation
|
|
90
|
+
Fetch from vite.config.json file
|
|
91
|
+
'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
|
|
92
|
+
'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
|
|
93
|
+
'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
|
|
94
|
+
'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Version 4.0.5
|
|
98
|
+
In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
Version 4.0.4
|
|
102
|
+
patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
|
|
103
|
+
|
|
104
|
+
Version 4.0.3
|
|
105
|
+
Old admob check performs through plugin location, but not it is validated from capacitor.config.json
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
Version: 4.0.2
|
|
109
|
+
After check & install/download the latest version, the re-check is cancelled now
|
|
110
|
+
|
|
111
|
+
Version: 4.0.1
|
|
112
|
+
Base profile script added
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
"version": "",
|
|
116
|
+
Version : 4.0.0 (Previous version 3.2.19)
|
|
117
|
+
1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
|
|
118
|
+
2) Removed "modify-plugin-xml.js"
|
|
119
|
+
3)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Screenshot Capture Rule
|
|
2
|
+
|
|
3
|
+
- Always capture from the current connected/online adb device only.
|
|
4
|
+
- Before running any screenshot command:
|
|
5
|
+
- Detect the first device with `device` state from `adb devices`.
|
|
6
|
+
- Do not use any key events (no power, wake, or lock/unlock commands).
|
|
7
|
+
- Do not use screen-state changes (`keyevent 26`, `keyevent 224`, etc.).
|
|
8
|
+
- Capture command sequence:
|
|
9
|
+
1. `adb -s <device-id> shell screencap -p /sdcard/current_connected_screenshot.png`
|
|
10
|
+
2. `adb -s <device-id> pull /sdcard/current_connected_screenshot.png _connected_screenshot.png`
|
|
11
|
+
3. `adb -s <device-id> shell rm /sdcard/current_connected_screenshot.png`
|
|
12
|
+
- If no device is in `device` state, stop and report `no_connected_device` before running any screenshot command.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# AGENT TEMP FOLDER RULE
|
|
2
|
+
|
|
3
|
+
- All temporary files and folders created while executing tasks (including images, cache files, debug output, and generated artifacts) **must be written only under the project-level `agent-temp/` directory**.
|
|
4
|
+
- Do not create or leave temporary artifacts in repository root, `src`, `www`, `public`, or other project folders.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Framework7 `.f7` New Page Standard (Cross-App)
|
|
2
|
+
|
|
3
|
+
## Source-of-truth and project scope
|
|
4
|
+
Use these files as mandatory baseline before creating any new page:
|
|
5
|
+
`AGENTS.md`, `AGENTS\agents.md`, existing pages under `src\pages`, `src\js\routes.js`, and theme files under `src\theme`.
|
|
6
|
+
Use the matching project’s actual files for any app where you are implementing this standard.
|
|
7
|
+
|
|
8
|
+
## Required page shape
|
|
9
|
+
Every new page file must use `.f7` with exactly one `<template>` and one `<script>`.
|
|
10
|
+
The root DOM must be one `.page` element with `data-name`.
|
|
11
|
+
|
|
12
|
+
Minimum skeleton:
|
|
13
|
+
```html
|
|
14
|
+
<template>
|
|
15
|
+
<div class="page" data-name="newPage">
|
|
16
|
+
<!-- optional navbar -->
|
|
17
|
+
<!-- page content -->
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
export default (props, { $f7, $el, $on }) => {
|
|
22
|
+
// lifecycle + handlers
|
|
23
|
+
return $render;
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Route integration rule
|
|
29
|
+
After creating any new `.f7` page, add it to `src\js\routes.js` with lazy async loading and route names ending in `/`, matching existing app routes.
|
|
30
|
+
Use this style:
|
|
31
|
+
```js
|
|
32
|
+
{
|
|
33
|
+
path: '/NewPageName/',
|
|
34
|
+
//component: newPageImport
|
|
35
|
+
async async({ resolve }) {
|
|
36
|
+
const page = await import('../pages/newpage.f7');
|
|
37
|
+
resolve({ component: page.default });
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Match the existing conventions exactly:
|
|
43
|
+
- path names use PascalCase and trailing slash.
|
|
44
|
+
- import path should point to `../pages/<file>.f7`.
|
|
45
|
+
- component is resolved from `page.default`.
|
|
46
|
+
|
|
47
|
+
## Back button rule (required)
|
|
48
|
+
All new pages must use the shared back handler from `src/js/back.js`.
|
|
49
|
+
|
|
50
|
+
Add this import:
|
|
51
|
+
```js
|
|
52
|
+
import { backButtonPress } from './../js/back.js';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use `backButtonPress` for every page back action in navbars, back links, and custom back controls.
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<div class="left">
|
|
59
|
+
<div class="link" @click="${backButtonPress}">
|
|
60
|
+
<img src="${backImage}" class="backIconImg"></img>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Do not use custom `router.back()` or manual `window.history.back()` in new pages.
|
|
66
|
+
If a page requires a custom close/exit confirmation, keep it inside `backButtonPress` central flow or `common` helpers, then wire the same handler.
|
|
67
|
+
|
|
68
|
+
The central `backButtonPress` flow must preserve the actual navigation source:
|
|
69
|
+
- Home keeps the app's existing exit-confirmation behavior.
|
|
70
|
+
- Pages with explicit product behavior may keep a named destination in `src/js/back.js`.
|
|
71
|
+
- All other pages must use the main Framework7 router history to return to the previous page.
|
|
72
|
+
- If no previous route exists, the central handler must return to Home.
|
|
73
|
+
- Do not add page-local back methods or hardcode Home in ordinary secondary pages.
|
|
74
|
+
|
|
75
|
+
When a page has popups/sheets/dialogs open, verify the shared handler’s behavior for overlays before adding extra back logic.
|
|
76
|
+
|
|
77
|
+
## Template structure (strict)
|
|
78
|
+
Use Framework7 layout components before any custom markup.
|
|
79
|
+
For pages with header actions use `.navbar` with `.navbar-bg`.
|
|
80
|
+
If theme color is needed, include `.theme-navbarBackColor`.
|
|
81
|
+
For content use `.page-content`.
|
|
82
|
+
For tab rows use `.subnavbar` + `.toolbar.toolbar-top.tabbar`.
|
|
83
|
+
For bottom action bars use `.toolbar.toolbar-bottom.tabbar`.
|
|
84
|
+
|
|
85
|
+
Examples:
|
|
86
|
+
`<div class="navbar"> <div class="navbar-bg theme-navbarBackColor"></div> <div class="navbar-inner">...</div> </div>`
|
|
87
|
+
|
|
88
|
+
`<div class="subnavbar theme-navbarBackColor"><div class="subnavbar-inner"><div class="toolbar toolbar-top tabbar">...</div></div></div>`
|
|
89
|
+
|
|
90
|
+
`<div class="toolbar toolbar-bottom tabbar theme-navbarBackColor"><div class="toolbar-inner">...</div></div>`
|
|
91
|
+
|
|
92
|
+
## Framework7 custom component enable/disable rule
|
|
93
|
+
If a new page uses a component beyond the currently enabled baseline, update these files first:
|
|
94
|
+
- `src/js/framework7-custom.js`
|
|
95
|
+
- `src/assets/css/framework7-custom.less`
|
|
96
|
+
|
|
97
|
+
Enable a component by uncommenting both:
|
|
98
|
+
- JS import and registration in `src/js/framework7-custom.js`
|
|
99
|
+
- matching LESS import in `src/assets/css/framework7-custom.less`
|
|
100
|
+
|
|
101
|
+
Disable a component by commenting both import/registration and LESS import.
|
|
102
|
+
Keep JS and LESS changes synchronized for each enabled component.
|
|
103
|
+
|
|
104
|
+
Keep this section app-agnostic.
|
|
105
|
+
For each app, enable only components that are required by that app and keep JS/LESS toggles synchronized in that app's own `framework7-custom` files.
|
|
106
|
+
|
|
107
|
+
## Grid and list policy
|
|
108
|
+
Use Framework7 utilities for columns:
|
|
109
|
+
`grid`, `grid-cols-*`, `grid-gap`, `display-flex`, and standard alignment classes.
|
|
110
|
+
Use framework list classes:
|
|
111
|
+
`list`, `list media-list`, `item-content`, `item-inner`, `item-title`.
|
|
112
|
+
Do not create new custom grid/list styles unless existing utilities are impossible.
|
|
113
|
+
|
|
114
|
+
## Navbar and status-bar behavior
|
|
115
|
+
If page has a header, add theme activation in lifecycle:
|
|
116
|
+
```js
|
|
117
|
+
$on("pageBeforeIn", () => {
|
|
118
|
+
ThemeController.activateForPage({
|
|
119
|
+
navColor: 'white',
|
|
120
|
+
statusColor: 'white',
|
|
121
|
+
navIsAutoMode: false,
|
|
122
|
+
statusIsAutoMode: false,
|
|
123
|
+
navCanChangeInNavScroll: false,
|
|
124
|
+
statusCanChangeInNavScroll: true
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If page needs translation updates, listen to app theme event in `pageInit`.
|
|
130
|
+
|
|
131
|
+
## Sheet / popup / popover / dialog usage
|
|
132
|
+
Use Framework7 APIs to create these controls.
|
|
133
|
+
Do not hand-style internals as ad-hoc floating containers.
|
|
134
|
+
For sheets use `sheet` element + `$f7.sheet.create`.
|
|
135
|
+
For popups use `$f7.popup.create`.
|
|
136
|
+
For popovers use `$f7.popover.create`.
|
|
137
|
+
For completion dialogs always set back behavior using dialog options, for example `dialogClass: 'namepopup-dialog dialog-back-no-close'`.
|
|
138
|
+
|
|
139
|
+
For non-dismissible bottom sheet/popups, use proper F7 class + safe-area aware spacing from shared styles.
|
|
140
|
+
|
|
141
|
+
## FAB policy
|
|
142
|
+
Use `.fab` and `.fab-button` classes only.
|
|
143
|
+
Avoid building custom floating action components with fixed positioned custom HTML.
|
|
144
|
+
If using FAB for mobile actions, set `right`, `bottom`, and alignment with F7 classes and existing utilities.
|
|
145
|
+
|
|
146
|
+
## Styling policy for new pages
|
|
147
|
+
Avoid inline style attributes in new pages.
|
|
148
|
+
Do not add custom CSS classes directly inside `.f7` unless truly unavoidable.
|
|
149
|
+
Also follow all theme rules in this app’s theme notes file (for example `src\theme\<theme-folder>\Notes.txt`) when designing page visuals.
|
|
150
|
+
If style is needed, define it in:
|
|
151
|
+
`src\theme\theme-x.x\theme.less`, `src\theme\theme-x.x\theme-dialog.less`, or `src\assets\css\common-x.x.less`.
|
|
152
|
+
All theme helper classes should be prefixed with `t-`.
|
|
153
|
+
Prefer theme classes like `theme-navbarBackColor`, `t-fade-img`, existing ripple utility classes, and shared page-level helper classes.
|
|
154
|
+
|
|
155
|
+
Theme file musts / reminders from `<theme-folder>\Notes.txt` (for example `theme-x.x\Notes.txt`):
|
|
156
|
+
- Prefer Framework7 classes first; only fallback to theme css when not possible.
|
|
157
|
+
- Use `theme-navbarBackColor` for navbar color consistency.
|
|
158
|
+
- Reuse existing utility variables like `--bg-main1`, `--bg-main2`, `--bg-main2-text`, `--tab-active-bg`, `--tab-inactive-text`, etc.
|
|
159
|
+
- Use shared theme class prefix `t-*` for all new custom theme classes.
|
|
160
|
+
- For images that must change by theme, use `data-image-light` / `data-image-dark` and call `ThemeController.activateForPage()` when needed.
|
|
161
|
+
- Theme-related changes should go to `src/theme/css/custom.less`, `src/theme/css/light.less`, or `src/theme/css/dark.less` only.
|
|
162
|
+
- For light/dark and system behavior checks, use existing `ThemeController` helpers.
|
|
163
|
+
- Do not change protected shared styles directly on a page with inline or per-page overrides unless explicitly required.
|
|
164
|
+
|
|
165
|
+
Do not modify `www` and do not edit protected shared files unless user explicitly grants permission.
|
|
166
|
+
Protected list is in `AGENTS.md`.
|
|
167
|
+
|
|
168
|
+
If you notice a missing instruction between this file and `Notes.txt`, update this instruction file first and follow the stricter one.
|
|
169
|
+
|
|
170
|
+
## Handler and event rules
|
|
171
|
+
Keep template event bindings minimal and avoid large inline arrow expressions in markup.
|
|
172
|
+
Define handlers as named functions and bind directly.
|
|
173
|
+
Keep DOM queries inside lifecycle events only.
|
|
174
|
+
|
|
175
|
+
Good pattern:
|
|
176
|
+
`@click="${onOpenMenu}"`, `@click="${openTemplatePopup}"`, `@click="${goBack}"`
|
|
177
|
+
Avoid repeating heavy anonymous callbacks inside markup.
|
|
178
|
+
|
|
179
|
+
## Reuse over duplication
|
|
180
|
+
Before creating helpers, check existing exported helpers in project js folders.
|
|
181
|
+
Prefer reuse of common functions in shared modules.
|
|
182
|
+
Do not introduce duplicate utilities for back navigation, theme switching, popover/popup creation, dialogs, toasts, or storage.
|
|
183
|
+
|
|
184
|
+
## Shared method first (required)
|
|
185
|
+
Before adding new helper methods, always search and reuse existing common methods in the project.
|
|
186
|
+
If a shared method already exists, do not create a new one.
|
|
187
|
+
|
|
188
|
+
Important shared method source for new pages:
|
|
189
|
+
- `./../js/common-x.x.js`
|
|
190
|
+
- theme/controller helpers already imported in existing pages (for example `ThemeController`)
|
|
191
|
+
|
|
192
|
+
From the project update notes:
|
|
193
|
+
- For back handling in app shell, `capacitor-app.js` must import:
|
|
194
|
+
`import { backButtonCheckAndExit } from './common-x.x.js';`
|
|
195
|
+
and call `backButtonCheckAndExit();` inside `handleAndroidBackButton`.
|
|
196
|
+
- If a new page needs spinner stop, import:
|
|
197
|
+
`import { stopSpinner } from './../js/common-x.x.js';`
|
|
198
|
+
|
|
199
|
+
Commonly available methods to prefer (examples):
|
|
200
|
+
- `hideForMethod`
|
|
201
|
+
- `shareApp` (with `noAppOpenShowUntilResume`)
|
|
202
|
+
- `shareContent` (with `noAppOpenShowUntilResume`)
|
|
203
|
+
- `rateUs` (with `noAppOpenShowUntilResume`)
|
|
204
|
+
- `gotoPrivacypolicy` (with `noAppOpenShowUntilResume`)
|
|
205
|
+
- `openDeveloperApps` (with `noAppOpenShowUntilResume`)
|
|
206
|
+
- `bugReportPopup`
|
|
207
|
+
- `showToast`
|
|
208
|
+
- `showSpinner`, `stopSpinner`
|
|
209
|
+
- `showAlertBox`
|
|
210
|
+
- `setLocalStorage`, `getLocalStorage`, `removeLocalStorage`
|
|
211
|
+
- `getExactContentHeight`
|
|
212
|
+
- `confirmDialog`
|
|
213
|
+
- `setNavBarColor`, `setStatusBarColor` (order note: call `setNavBarColor` first)
|
|
214
|
+
- `manageStorage(key).setState/getState/removeState`
|
|
215
|
+
- `initTouchableImages` for touch feedback animations
|
|
216
|
+
- `activateLogTracker`, `getConsoleData` (testing only)
|
|
217
|
+
|
|
218
|
+
Notes:
|
|
219
|
+
- `showPage`, `backButtonPress`, and theme-related helpers should remain consistent with existing patterns.
|
|
220
|
+
- Deprecated / removed methods from older notes should not be reintroduced.
|
|
221
|
+
|
|
222
|
+
## Required quality checklist before returning page code
|
|
223
|
+
Page file name and `data-name` are unique.
|
|
224
|
+
Navbar, page-content, and footer toolbar structure use Framework7 classes.
|
|
225
|
+
No new inline style blocks are used unless the exception is explicitly justified.
|
|
226
|
+
No hardcoded `background-color` at page element level unless required by theme variant.
|
|
227
|
+
No direct edits to protected files were made.
|
|
228
|
+
New route is added in `src\js\routes.js`.
|
|
229
|
+
At least one existing Framework7 component is used for each required UI area.
|
|
230
|
+
Theme activation and lifecycle usage is present when page has a header.
|
|
231
|
+
If dialog cannot close on back press, `dialogClass` rule is set at call site.
|
|
232
|
+
|
|
233
|
+
## Response rule for this repo
|
|
234
|
+
When codegen is requested from this file, follow this instruction order first:
|
|
235
|
+
structure, route, template layout, theme integration, handlers, then script wiring.
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
if you are using $$ you must import dom7
|