@networkpro/web 1.11.0 → 1.12.2
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/CHANGELOG.md +66 -0
- package/CHANGELOG.template.md +63 -0
- package/LICENSE.md +19 -8
- package/package.json +2 -2
- package/src/lib/pages/LicenseContent.svelte +22 -3
- package/src/lib/pages/PrivacyContent.svelte +67 -93
- package/src/lib/pages/PrivacyDashboard.svelte +66 -89
- package/src/lib/stores/posthog.js +8 -8
- package/src/lib/stores/trackingPreferences.js +222 -0
- package/src/lib/styles/css/default.css +12 -0
- package/src/lib/styles/global.min.css +1 -1
- package/src/routes/+layout.svelte +0 -2
- package/static/docs/tracking.md +63 -0
- package/static/img/fb-banner.png +0 -0
- package/svelte.config.js +1 -1
- package/CODE_OF_CONDUCT.md +0 -173
- package/src/lib/stores/trackingStatus.js +0 -30
- package/src/lib/utils/privacy.js +0 -81
- package/src/lib/utils/trackingCookies.js +0 -70
- package/src/lib/utils/trackingStatus.js +0 -61
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
<!-- =========================================================================
|
|
2
|
-
CODE_OF_CONDUCT.md
|
|
3
|
-
|
|
4
|
-
Copyright © 2025 Network Pro Strategies (Network Pro™)
|
|
5
|
-
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
6
|
-
This file is part of Network Pro.
|
|
7
|
-
========================================================================== -->
|
|
8
|
-
|
|
9
|
-
<a name="top"></a>
|
|
10
|
-
|
|
11
|
-
<sup>[SPDX-License-Identifier](https://spdx.dev/learn/handling-license-info):
|
|
12
|
-
`CC-BY-4.0 OR GPL-3.0-or-later`</sup>
|
|
13
|
-
|
|
14
|
-
# Contributor Covenant Code of Conduct
|
|
15
|
-
|
|
16
|
-
**Network Pro Strategies**
|
|
17
|
-
**Effective Date:** 3/21/2025
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Contents
|
|
22
|
-
|
|
23
|
-
- [Our Pledge](#pledge)
|
|
24
|
-
- [Our Standards](#standards)
|
|
25
|
-
- [Responsibilities](#response)
|
|
26
|
-
- [Scope](#scope)
|
|
27
|
-
- [Enforcement](#enforce)
|
|
28
|
-
- [Attribution](#attribute)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
<section id="pledge">
|
|
33
|
-
|
|
34
|
-
## Our Pledge
|
|
35
|
-
|
|
36
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
37
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
38
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
39
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
40
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
41
|
-
identity and orientation.
|
|
42
|
-
|
|
43
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
44
|
-
diverse, inclusive, and healthy community.
|
|
45
|
-
|
|
46
|
-
</section>
|
|
47
|
-
|
|
48
|
-
<section id="standards">
|
|
49
|
-
|
|
50
|
-
## Our Standards
|
|
51
|
-
|
|
52
|
-
Examples of behavior that contributes to a positive environment for our
|
|
53
|
-
community include:
|
|
54
|
-
|
|
55
|
-
- Demonstrating empathy and kindness toward other people
|
|
56
|
-
- Being respectful of differing opinions, viewpoints, and experiences
|
|
57
|
-
- Giving and gracefully accepting constructive feedback
|
|
58
|
-
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
59
|
-
and learning from the experience
|
|
60
|
-
- Focusing on what is best not just for us as individuals, but for the overall
|
|
61
|
-
community
|
|
62
|
-
|
|
63
|
-
Examples of unacceptable behavior include:
|
|
64
|
-
|
|
65
|
-
- The use of sexualized language or imagery, and sexual attention or advances of
|
|
66
|
-
any kind
|
|
67
|
-
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
68
|
-
- Public or private harassment
|
|
69
|
-
- Publishing others' private information, such as a physical or email address,
|
|
70
|
-
without their explicit permission
|
|
71
|
-
- Other conduct which could reasonably be considered inappropriate in a
|
|
72
|
-
professional setting
|
|
73
|
-
|
|
74
|
-
<sub>[Back to top](#top)</sub>
|
|
75
|
-
|
|
76
|
-
</section>
|
|
77
|
-
|
|
78
|
-
<section id="response">
|
|
79
|
-
|
|
80
|
-
## Responsibilities
|
|
81
|
-
|
|
82
|
-
Company and community leaders are responsible for clarifying and enforcing our standards of
|
|
83
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
84
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
85
|
-
or harmful.
|
|
86
|
-
|
|
87
|
-
Company and community leaders have the right and responsibility to remove, edit, or reject
|
|
88
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
89
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
90
|
-
decisions when appropriate.
|
|
91
|
-
|
|
92
|
-
Network Pro Strategies reserves the right, at its sole discretion, to remove, edit, or reject any contributions that are contrary to or detrimental to its business interests.
|
|
93
|
-
|
|
94
|
-
<sub>[Back to top](#top)</sub>
|
|
95
|
-
|
|
96
|
-
</section>
|
|
97
|
-
|
|
98
|
-
<section id="scope">
|
|
99
|
-
|
|
100
|
-
## Scope
|
|
101
|
-
|
|
102
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
103
|
-
an individual is officially representing the company or community in public spaces.
|
|
104
|
-
Examples of representing our company or community include using an official email address,
|
|
105
|
-
posting via an official social media account, or acting as an appointed
|
|
106
|
-
representative at an online or offline event.
|
|
107
|
-
|
|
108
|
-
<sub>[Back to top](#top)</sub>
|
|
109
|
-
|
|
110
|
-
</section>
|
|
111
|
-
|
|
112
|
-
<section id="enforce">
|
|
113
|
-
|
|
114
|
-
## Enforcement
|
|
115
|
-
|
|
116
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the abuse team at [abuse@neteng.pro](mailto:abuse@neteng.pro). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
|
|
117
|
-
|
|
118
|
-
The abuse team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
119
|
-
|
|
120
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
|
|
121
|
-
|
|
122
|
-
<sub>[Back to top](#top)</sub>
|
|
123
|
-
|
|
124
|
-
</section>
|
|
125
|
-
|
|
126
|
-
<section id="attribute">
|
|
127
|
-
|
|
128
|
-
## Attribution
|
|
129
|
-
|
|
130
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
131
|
-
version 2.1, available at
|
|
132
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
133
|
-
|
|
134
|
-
The **Enforcement** section is adapted from the
|
|
135
|
-
[Contributor Covenant][homepage],
|
|
136
|
-
version 1.4, available at
|
|
137
|
-
[https://www.contributor-covenant.org/version/1/4/code-of-conduct/][v1.4].
|
|
138
|
-
|
|
139
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
140
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
141
|
-
[https://www.contributor-covenant.org/translations][translations].
|
|
142
|
-
|
|
143
|
-
[homepage]: https://www.contributor-covenant.org
|
|
144
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
145
|
-
[v1.4]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/
|
|
146
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
147
|
-
[translations]: https://www.contributor-covenant.org/translations
|
|
148
|
-
|
|
149
|
-
<sub>[Back to top](#top)</sub>
|
|
150
|
-
|
|
151
|
-
</section>
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
<span style="font-size: 12px; font-weight: bold; text-align: center;">
|
|
156
|
-
|
|
157
|
-
[Home](https://netwk.pro) | [Terms of Use](https://netwk.pro/terms-of-use)
|
|
158
|
-
[Privacy Policy](https://netwk.pro/privacy) | [Legal](https://netwk.pro/license)
|
|
159
|
-
|
|
160
|
-
</span>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<span style="font-size: 12px; text-align: center;">
|
|
165
|
-
|
|
166
|
-
Copyright © 2025
|
|
167
|
-
**[Network Pro Strategies](https://netwk.pro/)** (Network Pro™)
|
|
168
|
-
|
|
169
|
-
Network Pro™, the shield logo, and the "Locking Down Networks™" slogan are [trademarks](https://netwk.pro/license#trademark) of Network Pro Strategies.
|
|
170
|
-
|
|
171
|
-
Licensed under **[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)** and the **[GNU GPL](https://spdx.org/licenses/GPL-3.0-or-later.html)**, as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
172
|
-
|
|
173
|
-
</span>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* ==========================================================================
|
|
2
|
-
src/lib/stores/trackingStatus.js
|
|
3
|
-
|
|
4
|
-
Copyright © 2025 Network Pro Strategies (Network Pro™)
|
|
5
|
-
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
6
|
-
========================================================================== */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @file trackingStatus.js
|
|
10
|
-
* @description Tracks state of PostHog tracking status for instant updates
|
|
11
|
-
* in Privacy Policy and Privacy Dashboard.
|
|
12
|
-
* @module src/lib/stores
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { writable } from "svelte/store";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Writable tracking status store.
|
|
19
|
-
* Initialized with fallback value and updated in browser context.
|
|
20
|
-
* @type {import("svelte/store").Writable<string>}
|
|
21
|
-
*/
|
|
22
|
-
export const trackingStatus = writable("⏳ Checking tracking preferences...");
|
|
23
|
-
|
|
24
|
-
// Dynamically import browser-only logic after mount
|
|
25
|
-
if (typeof window !== "undefined") {
|
|
26
|
-
import("$lib/utils/trackingStatus.js").then(({ getTrackingPreferences }) => {
|
|
27
|
-
const prefs = getTrackingPreferences();
|
|
28
|
-
trackingStatus.set(prefs.status);
|
|
29
|
-
});
|
|
30
|
-
}
|
package/src/lib/utils/privacy.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/* ==========================================================================
|
|
2
|
-
src/lib/utils/privacy.js
|
|
3
|
-
|
|
4
|
-
Copyright © 2025 Network Pro Strategies (Network Pro™)
|
|
5
|
-
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
6
|
-
This file is part of Network Pro.
|
|
7
|
-
========================================================================== */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @file privacy.js
|
|
11
|
-
* @description Determines whether the user allows tracking based on DNT, GPC, or manual opt-out.
|
|
12
|
-
* @module src/lib/utils/
|
|
13
|
-
* @author SunDevil311
|
|
14
|
-
* @updated 2025-06-03
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Check if user has manually set tracking preference.
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
export function hasUserManuallySetTrackingPreference() {
|
|
22
|
-
if (typeof document === "undefined") return false;
|
|
23
|
-
|
|
24
|
-
const cookies = document.cookie;
|
|
25
|
-
return (
|
|
26
|
-
cookies.includes("enable_tracking=true") ||
|
|
27
|
-
cookies.includes("disable_tracking=true")
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Determine if the user allows tracking based on cookies, DNT, and GPC.
|
|
33
|
-
* @returns {boolean}
|
|
34
|
-
*/
|
|
35
|
-
export function shouldTrackUser() {
|
|
36
|
-
if (
|
|
37
|
-
typeof window === "undefined" ||
|
|
38
|
-
typeof navigator === "undefined" ||
|
|
39
|
-
typeof document === "undefined"
|
|
40
|
-
) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const cookies = document.cookie;
|
|
45
|
-
const windowDNT = /** @type {any} */ (window).doNotTrack;
|
|
46
|
-
const navigatorGPC = /** @type {any} */ (navigator).globalPrivacyControl;
|
|
47
|
-
|
|
48
|
-
const dnt = navigator.doNotTrack === "1" || windowDNT === "1";
|
|
49
|
-
const gpc = navigatorGPC === true;
|
|
50
|
-
|
|
51
|
-
const manualOptOut = cookies.includes("disable_tracking=true");
|
|
52
|
-
const manualOptIn = cookies.includes("enable_tracking=true");
|
|
53
|
-
|
|
54
|
-
console.log("[Privacy] Opt-in cookie present:", manualOptIn);
|
|
55
|
-
console.log("[Privacy] Opt-out cookie present:", manualOptOut);
|
|
56
|
-
|
|
57
|
-
if (manualOptIn) return true;
|
|
58
|
-
if (manualOptOut) return false;
|
|
59
|
-
|
|
60
|
-
return !dnt && !gpc;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Determines if user should be reminded to reconsent (after 6 months).
|
|
65
|
-
* @returns {boolean}
|
|
66
|
-
*/
|
|
67
|
-
export function shouldRemindUserToReconsent() {
|
|
68
|
-
if (typeof document === "undefined") return false;
|
|
69
|
-
|
|
70
|
-
if (!hasUserManuallySetTrackingPreference()) return false;
|
|
71
|
-
|
|
72
|
-
const match = document.cookie.match(/tracking_consent_timestamp=(\d+)/);
|
|
73
|
-
if (!match) return true;
|
|
74
|
-
|
|
75
|
-
const timestamp = Number(match[1]);
|
|
76
|
-
if (isNaN(timestamp)) return true;
|
|
77
|
-
|
|
78
|
-
const age = Date.now() - timestamp;
|
|
79
|
-
|
|
80
|
-
return age > 1000 * 60 * 60 * 24 * 180; // 6 months
|
|
81
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* ==========================================================================
|
|
2
|
-
src/lib/utils/trackingCookies.js
|
|
3
|
-
|
|
4
|
-
Copyright © 2025 Network Pro Strategies (Network Pro™)
|
|
5
|
-
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
6
|
-
This file is part of Network Pro.
|
|
7
|
-
========================================================================== */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @file trackingCookies.js
|
|
11
|
-
* @description Handles setting, clearing, and toggling tracking preference cookies.
|
|
12
|
-
* @module src/lib/utils/
|
|
13
|
-
* @author SunDevil311
|
|
14
|
-
* @updated 2025-06-04
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// 6 months (in seconds). Will be centralized later.
|
|
18
|
-
const DEFAULT_COOKIE_MAX_AGE = 60 * 60 * 24 * 180;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Builds a standard cookie string for use in all tracking cookies.
|
|
22
|
-
* @param {number} maxAge
|
|
23
|
-
* @returns {string}
|
|
24
|
-
*/
|
|
25
|
-
function buildCookieSettings(maxAge) {
|
|
26
|
-
return `path=/; max-age=${maxAge}; expires=${new Date(Date.now() + maxAge * 1000).toUTCString()}; SameSite=Lax; Secure`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Sets tracking preference cookies based on type.
|
|
31
|
-
* @param {"enable" | "disable"} type
|
|
32
|
-
* @param {number} [maxAge=DEFAULT_COOKIE_MAX_AGE]
|
|
33
|
-
*/
|
|
34
|
-
export function setTrackingPreference(type, maxAge = DEFAULT_COOKIE_MAX_AGE) {
|
|
35
|
-
if (typeof document === "undefined") return; // SSR guard
|
|
36
|
-
|
|
37
|
-
const cookieSettings = buildCookieSettings(maxAge);
|
|
38
|
-
const now = Date.now();
|
|
39
|
-
|
|
40
|
-
if (type === "enable") {
|
|
41
|
-
document.cookie = `enable_tracking=true; ${cookieSettings}`;
|
|
42
|
-
document.cookie = `tracking_consent_timestamp=${now}; ${cookieSettings}`;
|
|
43
|
-
clearCookie("disable_tracking");
|
|
44
|
-
} else if (type === "disable") {
|
|
45
|
-
document.cookie = `disable_tracking=true; ${cookieSettings}`;
|
|
46
|
-
document.cookie = `tracking_consent_timestamp=${now}; ${cookieSettings}`;
|
|
47
|
-
clearCookie("enable_tracking");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Clears all tracking-related cookies.
|
|
53
|
-
*/
|
|
54
|
-
export function clearTrackingPreferences() {
|
|
55
|
-
if (typeof document === "undefined") return; // SSR guard
|
|
56
|
-
|
|
57
|
-
clearCookie("enable_tracking");
|
|
58
|
-
clearCookie("disable_tracking");
|
|
59
|
-
clearCookie("tracking_consent_timestamp");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Clears an individual cookie.
|
|
64
|
-
* @param {string} name
|
|
65
|
-
*/
|
|
66
|
-
function clearCookie(name) {
|
|
67
|
-
if (typeof document === "undefined") return; // SSR guard
|
|
68
|
-
|
|
69
|
-
document.cookie = `${name}=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax; Secure`;
|
|
70
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* ==========================================================================
|
|
2
|
-
src/lib/utils/trackingStatus.js
|
|
3
|
-
|
|
4
|
-
Copyright © 2025 Network Pro Strategies (Network Pro™)
|
|
5
|
-
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
6
|
-
This file is part of Network Pro.
|
|
7
|
-
========================================================================== */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @file trackingStatus.js
|
|
11
|
-
* @description Get tracking preferences based on cookies and browser privacy signals.
|
|
12
|
-
* @module src/lib/utils
|
|
13
|
-
* @author SunDevil311
|
|
14
|
-
* @updated 2025-05-28
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { browser } from "$app/environment";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Gets the current tracking preferences based on browser cookies and signals.
|
|
21
|
-
*
|
|
22
|
-
* @returns {{
|
|
23
|
-
* optedOut: boolean,
|
|
24
|
-
* optedIn: boolean,
|
|
25
|
-
* dnt: boolean,
|
|
26
|
-
* gpc: boolean,
|
|
27
|
-
* status: string
|
|
28
|
-
* }}
|
|
29
|
-
*/
|
|
30
|
-
export function getTrackingPreferences() {
|
|
31
|
-
// Prevent errors during SSR (no document or navigator)
|
|
32
|
-
if (!browser) {
|
|
33
|
-
return {
|
|
34
|
-
optedOut: false,
|
|
35
|
-
optedIn: false,
|
|
36
|
-
dnt: false,
|
|
37
|
-
gpc: false,
|
|
38
|
-
status: "⏳ Checking tracking preferences...",
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const cookies = document.cookie;
|
|
43
|
-
const optedOut = cookies.includes("disable_tracking=true");
|
|
44
|
-
const optedIn = cookies.includes("enable_tracking=true");
|
|
45
|
-
|
|
46
|
-
const dnt = navigator.doNotTrack === "1";
|
|
47
|
-
// @ts-expect-error: 'globalPrivacyControl' is non-standard
|
|
48
|
-
const gpc = navigator.globalPrivacyControl === true;
|
|
49
|
-
|
|
50
|
-
let status = "⚙️ Using default settings (tracking enabled)";
|
|
51
|
-
|
|
52
|
-
if (optedOut) {
|
|
53
|
-
status = "🔒 Tracking disabled (manual opt-out)";
|
|
54
|
-
} else if (optedIn) {
|
|
55
|
-
status = "✅ Tracking enabled (manual opt-in)";
|
|
56
|
-
} else if (dnt || gpc) {
|
|
57
|
-
status = "🛑 Tracking disabled (via browser signal)";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return { optedOut, optedIn, dnt, gpc, status };
|
|
61
|
-
}
|