Skip to content

Commit 680a2fb

Browse files
committed
Merge branch 'core' into manage-refresh/core
2 parents c6ef380 + 2a8dcc6 commit 680a2fb

File tree

17 files changed

+303
-81
lines changed

17 files changed

+303
-81
lines changed

.browserslistrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [3.9.2] (2025-11-17)
4+
5+
### Changed
6+
* Introduced a custom scissors icon and updated button title for the TinyMCE extension.
7+
* Improved back-navigation styling on the edit page.
8+
* Refined layout for column names and action buttons in the Cloud Snippets list.
9+
* Enhanced overall styling of cloud-related UI components.
10+
* Optimized cloud search with more efficient pagination and snippet retrieval.
11+
* Introduced groundwork to prevent Composer dependency collisions with other plugins.
12+
13+
### Fixed
14+
* Improved sanitization and normalization across Cloud API and pagination outputs.
15+
* Resolved various TinyMCE issues reported in the WordPress support forum.
16+
317
## [3.9.1] (2025-11-14)
418

519
### Changed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,45 @@ command:
6969
npm run watch
7070
```
7171

72+
## Managing Composer dependencies
73+
74+
Code Snippets uses the [Imposter plugin](https://github.com/TypistTech/imposter) to namespace-prefix all vendor
75+
dependencies under `Code_Snippets\Vendor\`. This prevents conflicts with other WordPress plugins that might use the
76+
same libraries (e.g., Guzzle, Minify, Monolog).
77+
78+
### Adding a new dependency
79+
80+
When adding a new Composer dependency that might exist in other plugins:
81+
82+
1. Add the package to `src/composer.json` as usual:
83+
```shell
84+
cd src
85+
composer require vendor/package
86+
```
87+
88+
2. Add corresponding PSR-4 autoload entries for the prefixed namespace in `src/composer.json`:
89+
```json
90+
"autoload": {
91+
"psr-4": {
92+
"Code_Snippets\\Vendor\\OriginalVendor\\PackageName\\": "vendor/vendor-name/package-name/src/"
93+
}
94+
}
95+
```
96+
97+
3. Run `composer dump-autoload -o` to regenerate autoload files.
98+
99+
4. The Imposter plugin will automatically rewrite the namespaces during `post-install-cmd` and `post-update-cmd` hooks.
100+
101+
5. Our autoloader in `src/php/load.php` automatically removes original (non-prefixed) namespace mappings to prevent
102+
collisions, so no code changes are needed.
103+
104+
### How it works
105+
106+
- Imposter rewrites all vendor code from `Vendor\Package\Class` to `Code_Snippets\Vendor\Vendor\Package\Class`
107+
- The `load.php` file dynamically detects and removes original namespace PSR-4 mappings at runtime
108+
- Other plugins can load their own versions of the same libraries without conflicts
109+
- Your code should always use the prefixed namespace: `use Code_Snippets\Vendor\Vendor\Package\Class;`
110+
72111
## Preparing for release
73112

74113
The plugin repository includes a number of files that are unnecessary when distributing the plugin files for

src/code-snippets.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@
88
* License: GPL-2.0-or-later
99
* License URI: license.txt
1010
* Text Domain: code-snippets
11+
<<<<<<< HEAD
1112
* Version: 3.10.0-dev.1
13+
=======
14+
* Version: 3.9.2
15+
>>>>>>> core
1216
* Requires PHP: 7.4
1317
* Requires at least: 5.5
1418
*
19+
<<<<<<< HEAD
1520
* @version 3.10.0-dev.1
21+
=======
22+
* @version 3.9.2
23+
>>>>>>> core
1624
* @package Code_Snippets
1725
* @author Shea Bunge <shea@codesnippets.pro>
1826
* @copyright 2012-2024 Code Snippets Pro

src/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"autoload": {
2424
"psr-4": {
25-
"Code_Snippets\\": "php/"
25+
"Code_Snippets\\": "php/"
2626
}
2727
},
2828
"require": {

src/css/common/_badges.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
gap: 5px;
2121
line-height: 1;
2222

23-
@at-root .row-actions & {
24-
color: #8c8c8c;
25-
padding-inline: 0px;
26-
text-transform: capitalize;
27-
font-weight: 500;
28-
}
23+
@at-root .row-actions & {
24+
color: #8c8c8c;
25+
padding-inline: 0;
26+
text-transform: capitalize;
27+
font-weight: 500;
28+
}
2929

3030
.dashicons {
3131
font-size: 18px;
@@ -37,7 +37,7 @@
3737
.network-shared {
3838
color: #2271b1;
3939
font-size: 22px;
40-
width: 100%;
40+
inline-size: 100%;
4141
cursor: help;
4242
}
4343

@@ -89,9 +89,9 @@
8989
background-color: #a7aaad;
9090
border-color: #fff !important;
9191

92-
.dashicons {
93-
color: #fff;
94-
}
92+
.dashicons {
93+
color: #fff;
94+
}
9595
}
9696

9797
.nav-tab-inactive {

src/css/edit.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,13 @@
9696
form.condition-snippet .snippet-code-container {
9797
display: none;
9898
}
99+
100+
.cs-back {
101+
cursor: pointer;
102+
103+
&::before {
104+
content: '<';
105+
color: #2271b1;
106+
margin-inline-end: 3px;
107+
}
108+
}

src/css/edit/_gpt.scss

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,66 @@
2020
.generate-button {
2121
display: flex;
2222
align-items: center;
23+
gap: 5px;
2324

2425
.dashicons-warning {
2526
color: #b32d2e;
2627
}
28+
29+
.snippet-tags-container &,
30+
.snippet-description-container & {
31+
float: inline-end;
32+
}
2733
}
2834

2935
.code-line-explanation {
3036
display: flex;
31-
align-items: center;
32-
font-size: 13px;
37+
cursor: default;
38+
font-size: inherit;
3339
margin: 0;
34-
padding-block: 0;
35-
padding-inline: 8px;
36-
background-color: #fff;
37-
border: 1px solid #bbb;
38-
border-inline-start: 0;
39-
border-inline-end: 0;
40+
padding-inline: 6px;
41+
border-inline-start: none;
42+
border-inline-end: none;
43+
border-block-start: 1px solid rgb(0 0 0 / 15%);
44+
border-block-end: 1px solid rgb(0 0 0 / 15%);
45+
border-image-slice: 1;
46+
border-image-width: 1;
47+
border-image-repeat: stretch;
4048
color: #666;
4149
font-style: italic;
42-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
50+
font-family: monospace;
51+
gap: 5px;
52+
align-items: center;
4353

4454
img {
4555
block-size: 1rem;
46-
padding-inline-end: 5px;
56+
opacity: 0.7;
57+
}
58+
59+
.code-line-actions {
60+
cursor: default;
61+
gap: 7px;
62+
display: inline-flex;
63+
margin-inline-start: 5px;
64+
font-family: system-ui;
65+
font-style: normal;
66+
67+
.commit {
68+
color: #3d9970;
69+
}
70+
71+
.remove {
72+
color: #b32d2e;
73+
}
74+
75+
.action {
76+
cursor: pointer;
77+
opacity: 0.6;
78+
79+
&:hover {
80+
opacity: 1;
81+
}
82+
}
4783
}
4884
}
4985

0 commit comments

Comments
 (0)